--------------------------------------------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  C:\Users\75618rpo\Dropbox\Research\Literature Latex\Corruption, accountability and voting\Submission R&R JoP\Replication\replication_packag
> e_JOP\cleaning_running.log
  log type:  text
 opened on:  22 Feb 2024, 09:32:04

. 
. * Install packages
. capture ssc install estout

. capture ssc install balancetable

. 
. * Code files
. 
. local code_main_estimations                                     "main_estimations.do"

. local code_Appendix_C                                           "Appendix_C.do"

. local code_analysis_polls                                       "analysis_polls.do"

. local code_analysis_extras                                      "analysis_extras.do"

. local code_Appendix_D                                           "Appendix_D.do"

. 
. 
. ********************************************************************************
. 
. * Switches: these control which parts of the data cleaning & running code you will re-run.
. * Also, each do file can be ran independently.
. #delimit ;
delimiter now ;
. local switches_all
>         main_estimations
>         Appendix_C
>         analysis_polls
>         analysis_extras
>         Appendix_D 
> ;

. #delimit cr
delimiter now cr
. 
. local switch_main_estimations                           = 1

. local switch_Appendix_C                                         = 1

. local switch_analysis_polls                                     = 1

. local switch_analysis_extras                            = 1

. local switch_Appendix_D                                         = 1 

. 
. ********************************************************************************
. 
. // Start timer
. timer on 1

. 
. foreach switch of local switches_all {
  2.         if `switch_`switch'' {
  3.                 cd "${code_cleaning}"
  4.                 do `code_`switch''
  5.         }
  6. }
C:\Users\75618rpo\Dropbox\Research\Literature Latex\Corruption, accountability and voting\Submission R&R JoP\Replication\replication_package_JOP

. clear all

. set more off

. program drop _all

. macro drop _all

. 
. cd "C:\Users\75618rpo\Dropbox\Research\Literature Latex\Corruption, accountability and voting\Submission R&R JoP\Replication\replication_package_JOP"
C:\Users\75618rpo\Dropbox\Research\Literature Latex\Corruption, accountability and voting\Submission R&R JoP\Replication\replication_package_JOP

. 
. use "data_brasil_camp.dta", clear

. 
.         global muni_controls lpib_pc gini illiteracy share_urb radio_am 

.                 label var lpib_pc "GDP per capita (in ln)"

.                 label var radio_am "AM Radio Station"

.                 label var gini "Gini index"

.                 label var illiteracy "Illiteracy rate"

.                 label var share_urb     "Share urban population"

.         
.         global mayor_controls male married age education prev_mayor share_vote_margin dum_PT

.                 label var prev_mayor "Previous mayor"

.                 label var dum_PT "Workers' Party dummy"

.                 
.         global challengers_outcomes total_cand mean_educ mean_skilled mean_age 

.         global challenger_controls male married age education prev_mayor dum_PT

.         global cluster id_city

. 
.         label var month0_3 "Before 3 months"

.         label var month3_12 "Between 3 to 12 months"

.         label var month12_n "Over 12 months"    

.         
. cls

. * Reputation shocks measures (corruption)
.                 *(1) Corruption
.                 label var before "Before"

.                 capture gen before_broad = before * broad

.                                 label var before_broad "Before $\times$ corruption"

.                                 label var broad "Corruption"

.                                 
.                 *(2) Fraction
.                 capture gen corrupt_before = before * fraction_broad

.                                 label var corrupt_before "Before $\times$ share corruption"

.                                 label var fraction_broad "Share corruption"

.                 
.                 *(3) Median
.                 capture gen above_median_corrupt = .

.                 quietly sum fraction_broad if term == 2001, d

.                 capture replace above_median_corrupt = (fraction_broad> r(p50)) if fraction_broad ~= . & term == 2001

.                 quietly sum fraction_broad if term == 2005, d

.                 capture replace above_median_corrupt = (fraction_broad> r(p50)) if fraction_broad ~= . & term == 2005

.                         label var above_median_corrupt "Above median corruption" 

. 
.                 capture gen median_before = before * above_median_corrupt

.                                 label var median_before "Before $\times$ Above median corruption"

.                 
.                 *(4) Quartiles
.                   capture drop quart*

.                   
.                   xtile quartile_broad2001 = fraction_broad if term == 2001, nquantiles(4)

.                   xtile quartile_broad2005 = fraction_broad if term == 2005, nquantiles(4)

.                   gen quartile_broad = quartile_broad2001 if term == 2001
(589 missing values generated)

.                   replace quartile_broad = quartile_broad2005 if term == 2005
(511 real changes made)

.                         label var quartile_broad "Corresponding quartile associated with fraction_broad"

.                         
.                   tabulate quartile_broad, gen(quartile)

Correspondi |
ng quartile |
 associated |
       with |
fraction_br |
        oad |      Freq.     Percent        Cum.
------------+-----------------------------------
          1 |        523       40.64       40.64
          2 |        121        9.40       50.04
          3 |        322       25.02       75.06
          4 |        321       24.94      100.00
------------+-----------------------------------
      Total |      1,287      100.00

.         
.                   gen quart2_before = before * quartile2
(78 missing values generated)

.                   gen quart3_before = before * quartile3
(78 missing values generated)

.                   gen quart4_before = before * quartile4
(78 missing values generated)

.                                 label var quart2_before "Before $\times$ 2nd quartile of corruption"

.                                 label var quart3_before "Before $\times$ 3rd quartile of corruption"

.                                 label var quart4_before "Before $\times$ 4th quartile of corruption"

.                                 label var quartile1 "1st quartile of corruption"

.                                 label var quartile2 "2nd quartile of corruption"

.                                 label var quartile3 "3rd quartile of corruption"

.                                 label var quartile4 "4th quartile of corruption"        

.                                 
.                                 label var broad "Corruption"

.                                 label var fraction_broad "Share corruption"

. 
.                 capture drop month0_3 month3_12 month12_n 

.                 
.                 gen month0_3 = (lottery == 8 | lottery == 9 )

.                 gen month3_12 = (lottery >= 4 & lottery <= 7 )

.                         replace month3_12 = (lottery >=23 & lottery <=25 ) if term == 2005
(127 real changes made)

.                 gen month12_n = (lottery <=3)

.                         replace month12_n = 1 if term == 2005 & before == 1 & lottery< 23
(269 real changes made)

. 
.                         label var month0_3 "Less than 3 months before the election"

.                         label var month3_12 "Betweem 3 to 12 months before the election"

.                         label var month12_n "More than 12 months before the election"

. 
.                 capture drop median_month0_3 median_month3_12 median_year12_n

.                 
.                 gen median_month0_3 = above_median_corrupt *  month0_3 
(78 missing values generated)

.                 gen median_month3_12 = above_median_corrupt *  month3_12 
(78 missing values generated)

.                 gen median_year12_n =  above_median_corrupt *  month12_n
(78 missing values generated)

. 
.                         label var median_month0_3 "Before 3 months $\times$ Above median corruption"

.                         label var median_month3_12 "Between 3-12 months $\times$ Above median corruption"

.                         label var median_year12_n "Over 12 months $\times$ Above median corruption"

. 
.                                 
.         global corruption_vars broad fraction_broad above_median_corrupt quartile1 quartile2 quartile3 quartile4

.         
. 
. 
. * Table 1. Summary statistics Corruption measure.
.                 tabstat broad if term == 2001, s(N mean) c(s) format (%6.2f)

    Variable |         N      Mean
-------------+--------------------
       broad |    808.00      0.70
----------------------------------

.                 tabstat broad if term == 2005, s(N mean) c(s) format (%6.2f)

    Variable |         N      Mean
-------------+--------------------
       broad |    557.00      0.88
----------------------------------

.                 
.                 tabstat fraction_broad if term == 2001, s(N mean p25 median p75 max) c(s) format (%6.2f)

    Variable |         N      Mean       p25       p50       p75       Max
-------------+------------------------------------------------------------
fraction_b~d |    776.00      4.43      0.00      0.09      4.41     90.50
--------------------------------------------------------------------------

.                 tabstat fraction_broad if term == 2005, s(N mean p25 median p75 max) c(s) format (%6.2f)

    Variable |         N      Mean       p25       p50       p75       Max
-------------+------------------------------------------------------------
fraction_b~d |    511.00      5.79      0.00      2.03      7.13     84.30
--------------------------------------------------------------------------

. 
.                 
. * Figure 1
. preserve 

.         collapse date_lot before month* year* (count) number=sample_camp_exp if sample_camp_exp == 1, by(term lottery)

. 
.         gen election_date = "2001-2004 term" if term == 2001
(14 missing values generated)

.                 replace election_date = "2005-2008 term" if term == 2005
(14 real changes made)

.                 
.         twoway (bar number date_lot, barwidth(15)) (bar number date_lot if before == 1, barwidth(15)), by(election_date, note("") legend(pos(6))) xlin
> e(16347 17815 , lwidth(medthick) lpattern(dash) lcolor(gs8)) graphregion(fcolor(white) lcolor(white))  xtitle("") ytitle("Municipalities")   legend( l
> abel(1 "Information after") label(2 "Information before") bmargin(vsmall) col(2)) xlabel(, format(%td) labsize(vsmall))   

.                         graph export "tables and figures/figure_1.pdf", replace
file tables and figures/figure_1.pdf saved as PDF format

. restore         

.                 
. 
. * Table 2. Balance Test for Incumbents
. preserve

.         global size_column "{p{5cm}p{1cm}p{1cm}p{1cm}p{1cm}p{1.5cm}p{1.5cm}c}"

.         global format_table "vce(cluster $cluster) wide(mean1 sd1 mean2 sd2 diff pval) pvalues varlabels  format(%9.2f) nostars nonumbers noobservatio
> ns nolines"

. 
.         replace radio_am = 100 if radio_am == 1 /*so it is in %*/
(335 real changes made)

.         
.         balancetable before broad fraction_broad using "tables and figures/table_2a.tex" if sample_camp_exp == 1, $format_table replace prehead("\begi
> n{tabularx}{\linewidth} $size_column \textit{A. Reputation shocks} \\") postfoot("\end{tabularx}") 

.         
.         balancetable before $mayor_controls using "tables and figures/table_2b.tex" if sample_camp_exp == 1, $format_table replace prehead("\begin{tab
> ularx}{\linewidth}  $size_column {\textit{B. Mayor characteristics}} \\") postfoot("\end{tabularx}") 

. 
.         balancetable before $muni_controls using "tables and figures/table_2c.tex" if sample_camp_exp == 1, $format_table replace prehead("\begin{tabu
> larx}{\linewidth} $size_column {\textit{C. Municipal characteristics}} \\") postfoot("\end{tabularx}")    

. restore

. 
. * Table 3. Balance Test for Challenger. 
. preserve

. use "data_brasil_camp_chall.dta", clear

. 
.                 label var lpib_pc "GDP per capita (in ln)"

.                 label var radio_am "AM Radio Station"

.                 label var gini "Gini index"

.                 label var illiteracy "Illiteracy rate"

.                 label var share_urb     "Share urban population"

.                 label var prev_mayor "Previous mayor"

.                 label var male "Male"

.                 label var married "Married"

.                 label var age "Age"

.                 label var education "Education"

.                 label var dum_PT "Workers' Party dummy"

.                 label var broad "Corruption"

.                 label var fraction_broad "Share corruption"

. 
.         keep if sample_camp_exp_chal == 1
(0 observations deleted)

.         tab before

      Audit |
 report was |
   released |
     before |
  elections |      Freq.     Percent        Cum.
------------+-----------------------------------
      After |        444       52.92       52.92
     Before |        395       47.08      100.00
------------+-----------------------------------
      Total |        839      100.00

.         tab before if fraction_broad !=.

      Audit |
 report was |
   released |
     before |
  elections |      Freq.     Percent        Cum.
------------+-----------------------------------
      After |        423       53.95       53.95
     Before |        361       46.05      100.00
------------+-----------------------------------
      Total |        784      100.00

.         replace radio_am = 100 if radio_am == 1 /*so it is in %*/
(208 real changes made)

.         
.         global size_column "{p{5cm}p{1cm}p{1cm}p{1cm}p{1cm}p{1.5cm}p{1.5cm}c}"

.         global format_table "vce(cluster $cluster) wide(mean1 sd1 mean2 sd2 diff pval) pvalues varlabels  format(%9.2f) nostars nonumbers noobservatio
> ns nolines"

.         
.         balancetable before broad fraction_broad using "tables and figures/table_3a.tex", $format_table replace prehead("\begin{tabularx}{\linewidth} 
> $size_column \textit{A. Reputation shocks} \\") postfoot("\end{tabularx}") 

.         
.         balancetable before $challenger_controls using "tables and figures/table_3b.tex", $format_table replace prehead("\begin{tabularx}{\linewidth} 
>  $size_column {\textit{B. Challenger characteristics}} \\") postfoot("\end{tabularx}") 

. 
.         balancetable before $muni_controls using "tables and figures/table_3c.tex", $format_table replace prehead("\begin{tabularx}{\linewidth} $size_
> column {\textit{C. Municipal characteristics}} \\") postfoot("\end{tabularx}")    

.         
. restore

. 
.         
.         
. * Table 4.
. eststo clear    

. preserve

. keep if sample_camp_exp == 1
(482 observations deleted)

. 
.         * 0. Baseline: Average causal Impact of Information Disclosure.
.                 eststo reg_broad_basic: quietly areg camp_exp_pc before i.term , absorb(codigo_uf) robust cluster($cluster)

.                                 sum camp_exp_pc if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "2.870"

.                                 estadd local state_fe "\checkmark": reg_broad_basic

. 
.                 * 0.1. baseline + controls
.                 eststo reg_broad_basic_c: quietly areg camp_exp_pc before $muni_controls $mayor_controls i.term , absorb(codigo_uf) robust cluster($cl
> uster)

.                                 sum camp_exp_pc if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "2.870"

.                                 estadd local state_fe "\checkmark": reg_broad_basic_c

.                                 estadd local mayor_municipal "\checkmark": reg_broad_basic_c

. 
.         
.         * 1. Broad                              
.                 eststo reg_broad: quietly areg camp_exp_pc before broad before_broad i.term , absorb(codigo_uf) robust cluster($cluster)

.                                 sum camp_exp_pc if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "2.870"

.                                 estadd local state_fe "\checkmark": reg_broad

.                                 lincom before + before_broad

 ( 1)  before + before_broad = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .0681043   .2351285     0.29   0.772    -.3934219    .5296305
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': reg_broad

.                                 estadd local p_value `p_test': reg_broad

. 
.                 *1.2. broad + controls                  
.                 eststo reg_broad_c: quietly areg camp_exp_pc before broad before_broad  $muni_controls $mayor_controls i.term , absorb(codigo_uf) robu
> st cluster($cluster)

.                                 sum camp_exp_pc if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "2.870"

.                                 estadd local state_fe "\checkmark": reg_broad_c

.                                 estadd local mayor_municipal "\checkmark": reg_broad_c

.                                 lincom before + before_broad

 ( 1)  before + before_broad = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .1024699   .2322635     0.44   0.659    -.3534328    .5583726
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': reg_broad_c

.                                 estadd local p_value `p_test': reg_broad_c                              

. 
.         * 2. fraction_broad             
.                 eststo reg_fraction: quietly areg camp_exp_pc before fraction_broad corrupt_before i.term, absorb(codigo_uf) robust  cluster($cluster)

.                                 sum camp_exp_pc if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "2.854"

.                                 estadd local state_fe "\checkmark": reg_fraction

.                                 sum fraction_broad if e(sample), mean 

.                                 loc my_mean: display %9.3f r(mean)                              

.                                 lincom before + corrupt_before * `my_mean'      

 ( 1)  before + 5.164*corrupt_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |  -.1268652   .2136479    -0.59   0.553    -.5462581    .2925277
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': reg_fraction

.                                 estadd local p_value `p_test': reg_fraction             

.                                 
.                 *2.2 fraction_broad + controls                  
.                 eststo reg_fraction_c: quietly areg camp_exp_pc before fraction_broad corrupt_before $muni_controls $mayor_controls  i.term, absorb(co
> digo_uf) robust  cluster($cluster)

.                                 sum camp_exp_pc if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "2.854"

.                                 estadd local state_fe "\checkmark": reg_fraction_c

.                                 estadd local mayor_municipal "\checkmark": reg_fraction_c

.                                 sum fraction_broad if e(sample), mean 

.                                 loc my_mean: display %9.3f r(mean)                              

.                                 lincom before + corrupt_before * `my_mean'      

 ( 1)  before + 5.164*corrupt_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |  -.0816975   .2083276    -0.39   0.695    -.4906467    .3272516
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': reg_fraction_c

.                                 estadd local p_value `p_test': reg_fraction_c

.                                                                 
.         * 3. above_median_broad                                                         
.                 eststo reg_median: quietly areg camp_exp_pc before above_median_corrupt median_before i.term, absorb(codigo_uf) robust  cluster($clust
> er)

.                                 sum camp_exp_pc if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "2.854"

.                                 estadd local state_fe "\checkmark": reg_median

.                                 lincom before + median_before

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .5545098   .3140333     1.77   0.078    -.0619408     1.17096
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': reg_median

.                                 estadd local p_value `p_test': reg_median

. 
.                 *3.2. above_median_broad + controls     
.                 eststo reg_median_c: quietly areg camp_exp_pc before above_median_corrupt median_before $muni_controls $mayor_controls i.term, absorb(
> codigo_uf) robust  cluster($cluster)

.                                 sum camp_exp_pc if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "2.854"

.                                 estadd local state_fe "\checkmark": reg_median_c

.                                 estadd local mayor_municipal "\checkmark": reg_median_c

.                                 lincom before + median_before

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .5435313   .3156131     1.72   0.085    -.0760204    1.163083
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': reg_median_c

.                                 estadd local p_value `p_test': reg_median_c

. 
.         * 4. quartiles broad
.                 eststo reg_quart:   quietly areg camp_exp_pc before quartile2 quartile3 quartile4 quart2_before quart3_before quart4_before i.term, ab
> sorb(codigo_uf) robust cluster($cluster)

.                                 sum camp_exp_pc if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "2.854"

.                                 estadd local state_fe "\checkmark": reg_quart

.                                 * 2nd quartile
.                                 lincom before + quart2_before

 ( 1)  before + quart2_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |  -.0985509   .6087541    -0.16   0.871    -1.293541     1.09644
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2q2 `estimate': reg_quart

.                                 estadd local p_valueq2 `p_test': reg_quart              

.                                 * 3rd quartile
.                                 lincom before + quart3_before

 ( 1)  before + quart3_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |    .554674   .4241748     1.31   0.191    -.2779853    1.387333
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2q3 `estimate': reg_quart

.                                 estadd local p_valueq3 `p_test': reg_quart

.                                 * 4th quartile
.                                 lincom before + quart4_before

 ( 1)  before + quart4_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .4886904   .4420025     1.11   0.269    -.3789648    1.356346
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2q4 `estimate': reg_quart

.                                 estadd local p_valueq4 `p_test': reg_quart 

.                                 
.                 *4.2 quartiles broad + controls
.                 eststo reg_quart_c: quietly areg camp_exp_pc before quartile2 quartile3 quartile4 quart2_before quart3_before quart4_before $muni_cont
> rols $mayor_controls   i.term, absorb(codigo_uf) robust  cluster($cluster)

.                                 sum camp_exp_pc if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "2.854"

.                                 estadd local state_fe "\checkmark": reg_quart_c

.                                 estadd local mayor_municipal "\checkmark": reg_quart_c

.                                 * 2nd quartile
.                                 lincom before + quart2_before

 ( 1)  before + quart2_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |    .117081    .632571     0.19   0.853    -1.124662    1.358824
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2q2 `estimate': reg_quart_c

.                                 estadd local p_valueq2 `p_test': reg_quart_c            

.                                 * 3rd quartile
.                                 lincom before + quart3_before

 ( 1)  before + quart3_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .6164428   .4387328     1.41   0.160     -.244794     1.47768
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2q3 `estimate': reg_quart_c

.                                 estadd local p_valueq3 `p_test': reg_quart_c

.                                 * 4th quartile
.                                 lincom before + quart4_before

 ( 1)  before + quart4_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .4362482   .4446809     0.98   0.327    -.4366648    1.309161
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2q4 `estimate': reg_quart_c

.                                 estadd local p_valueq4 `p_test': reg_quart_c 

.                                         
. * EXPORT TABLE TO LATEX         
.                 #delimit;
delimiter now ;
.                         esttab reg_broad_basic reg_broad_basic_c reg_broad reg_broad_c reg_fraction reg_fraction_c reg_median reg_median_c reg_quart r
> eg_quart_c
>                         using "tables and figures/table_4.tex", b(3) se compress label star(* 0.10 ** 0.05 *** 0.01) replace
>                         mgroups( "\shortstack{Information \\ disclosure}" "Corruption"   "Share corruption"  "\shortstack{Median \\ Corruption}"   "\s
> hortstack{Quartiles\\ Corruption}"  , pattern(1 0 1 0 1 0 1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) 
>                         keep(before_broad before broad corrupt_before fraction_broad median_before above_median_corrupt quartile2 quartile3 quartile4 
> quart2_before quart3_before quart4_before ) 
>                         stats(N mD mayor_municipal state_fe r2_a b0_b2 p_value b0_b2q2 p_valueq2 b0_b2q3 p_valueq3 b0_b2q4 p_valueq4, fmt(%9.0fc %9.3f
> c ) labels("Observations" "Dep. Var. Mean" "Mayor and municipal controls" "State and term FE" "Adjusted R$^2$" "$\beta_0+\beta_2 \, c_{ist}$" "p-value
> " "$\beta_0+\beta_2 \, c_{ist}$ (quartile 2)" "p-value" "$\beta_0+\beta_2 \, c_{ist}$ (quartile 3)" "p-value" "$\beta_0+\beta_2 \, c_{ist}$ (quartile 
> 4)" "p-value"))
>                         /*nonum*/ ar2 booktabs nonotes nomtitles title(deletethis) 
>                         substitute(\begin{table}[htbp]\centering \centering \caption{deletethis} /*\footnotesize*/{ \end{tabular} \end{tabular}} \end{
> table} %);
(output written to tables and figures/table_4.tex)

.                 #delimit cr
delimiter now cr
. restore

.                 
.                 
. 
. * Table 5.
. preserve

. cls             

. eststo clear    

. use "data_brasil_camp_chall.dta", clear

. 
.         global dep_var camp_exp_pc

.         global BEFORE before

.         global corrupt broad

.         
.         sum fraction_$corrupt

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
fraction_b~d |        784    5.056113    10.22464          0   84.29825

.         capture gen av_fraction_$corrupt = r(mean)

. 
.         
.         * 0. Baseline: 
.                 eststo reg_broad_basic: quietly areg $dep_var $BEFORE i.term , absorb(codigo_uf) robust cluster(id_city)

.                                 sum $dep_var if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "3.268"

.                                 estadd local state_fe "\checkmark": reg_broad_basic

. 
.                 *0.1. baseline + controls
.                 eststo reg_broad_basic_c: quietly areg $dep_var $BEFORE $muni_controls $challenger_controls i.term , absorb(codigo_uf) robust cluster(
> id_city)

.                                 sum $dep_var if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "3.268"

.                                 estadd local state_fe "\checkmark": reg_broad_basic_c

.                                 estadd local mayor_municipal "\checkmark": reg_broad_basic_c

. 
.         * 1. Broad
.                 capture gen before_$corrupt = $BEFORE * $corrupt

.                                 label var before_$corrupt "Before $\times$ corruption"

.                                 label var $corrupt "Corruption"

.                                 
.                 eststo reg_broad: quietly areg $dep_var $BEFORE $corrupt before_$corrupt i.term , absorb(codigo_uf) robust cluster(id_city)

.                                 sum $dep_var if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "3.268"

.                                 estadd local state_fe "\checkmark": reg_broad

.                                 test $BEFORE + before_$corrupt == 0     

 ( 1)  before + before_broad = 0

       F(  1,   768) =    2.88
            Prob > F =    0.0902

.                                 lincom $BEFORE + before_$corrupt

 ( 1)  before + before_broad = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .4974917   .2932518     1.70   0.090    -.0781785    1.073162
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': reg_broad

.                                 estadd local p_value `p_test': reg_broad

. 
.                 *1.2. broad + controls                  
.                 eststo reg_broad_c: quietly areg $dep_var $BEFORE $corrupt before_$corrupt  $muni_controls $challenger_controls i.term , absorb(codigo
> _uf) robust cluster(id_city)

.                                 sum $dep_var if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "3.268"

.                                 estadd local state_fe "\checkmark": reg_broad_c

.                                 estadd local mayor_municipal "\checkmark": reg_broad_c

.                                 lincom $BEFORE + before_$corrupt

 ( 1)  before + before_broad = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |    .513035   .2965804     1.73   0.084    -.0691694    1.095239
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': reg_broad_c

.                                 estadd local p_value `p_test': reg_broad_c

. 
.         * 2. fraction_broad
.                 capture gen corrupt_before = $BEFORE * fraction_$corrupt

.                                 label var corrupt_before "Before $\times$ share corruption"

.                                 label var fraction_$corrupt "Share corruption"

.                 
.                 eststo reg_fraction: quietly areg $dep_var $BEFORE fraction_$corrupt corrupt_before i.term, absorb(codigo_uf) robust  cluster(id_city)

.                                 sum $dep_var if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "3.258"

.                                 estadd local state_fe "\checkmark": reg_fraction

.                                 sum fraction_$corrupt if e(sample), mean 

.                                 loc my_mean: display %9.3f r(mean)                              

.                                 lincom $BEFORE + corrupt_before * `my_mean'     

 ( 1)  before + 5.056*corrupt_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .2505775   .2611226     0.96   0.338    -.2620705    .7632254
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': reg_fraction

.                                 estadd local p_value `p_test': reg_fraction

.                                 
.                 *2.2 fraction_broad + controls                  
.                 eststo reg_fraction_c: quietly areg $dep_var $BEFORE fraction_$corrupt corrupt_before $muni_controls $challenger_controls  i.term, abs
> orb(codigo_uf) robust  cluster(id_city)

.                                 sum $dep_var if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "3.258"

.                                 estadd local state_fe "\checkmark": reg_fraction_c

.                                 estadd local mayor_municipal "\checkmark": reg_fraction_c

.                                 sum fraction_$corrupt if e(sample), mean 

.                                 loc my_mean: display %9.3f r(mean)                              

.                                 lincom $BEFORE + corrupt_before * `my_mean'     

 ( 1)  before + 5.056*corrupt_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .3075253   .2594976     1.19   0.236    -.2019323    .8169829
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': reg_fraction_c

.                                 estadd local p_value `p_test': reg_fraction_c

.                                                                 
.         * 3. above_median_broad                                 
.                 local dep_var camp_exp_pc

.                 eststo reg_median: quietly areg $dep_var $BEFORE above_median_corrupt median_before i.term, absorb(codigo_uf) robust  cluster(id_city)

.                                 sum $dep_var if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "3.258"

.                                 estadd local state_fe "\checkmark": reg_median

.                                 lincom $BEFORE + median_before

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   1.096772   .4092429     2.68   0.008     .2933276    1.900216
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': reg_median

.                                 estadd local p_value `p_test': reg_median

. 
.                 *3.2. above_median_broad + controls
.                 eststo reg_median_c: quietly areg $dep_var $BEFORE above_median_corrupt median_before $muni_controls $challenger_controls i.term, abso
> rb(codigo_uf) robust  cluster(id_city)

.                                 sum $dep_var if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "3.258"

.                                 estadd local state_fe "\checkmark": reg_median_c

.                                 estadd local mayor_municipal "\checkmark": reg_median_c

.                                 lincom $BEFORE + median_before

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   1.132952   .4147502     2.73   0.006     .3186953    1.947209
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': reg_median_c

.                                 estadd local p_value `p_test': reg_median_c

.                                 
.                                 
.         * 4. quartiles broad
.                         
.                 eststo reg_quart:   quietly areg $dep_var $BEFORE quartile2 quartile3 quartile4 quart2_before quart3_before quart4_before i.term, abso
> rb(codigo_uf) robust cluster(id_city)

.                                 sum $dep_var if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "3.258"

.                                 estadd local state_fe "\checkmark": reg_quart

.                                 estadd local p_value `p_test': reg_quart

.                                 * 2nd quartile
.                                 lincom before + quart2_before

 ( 1)  before + quart2_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .6210665    .810094     0.77   0.444    -.9693474     2.21148
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2q2 `estimate': reg_quart

.                                 estadd local p_valueq2 `p_test': reg_quart              

.                                 * 3rd quartile
.                                 lincom before + quart3_before

 ( 1)  before + quart3_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   1.205988   .7175311     1.68   0.093     -.202702    2.614678
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2q3 `estimate': reg_quart

.                                 estadd local p_valueq3 `p_test': reg_quart

.                                 * 4th quartile
.                                 lincom before + quart4_before

 ( 1)  before + quart4_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   1.008735   .4700909     2.15   0.032     .0858314     1.93164
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2q4 `estimate': reg_quart

.                                 estadd local p_valueq4 `p_test': reg_quart 

. 
.                 *4.2 quartiles broad + controls
.                 eststo reg_quart_c: quietly areg $dep_var $BEFORE quartile2 quartile3 quartile4 quart2_before quart3_before quart4_before $muni_contro
> ls $challenger_controls   i.term, absorb(codigo_uf) robust  cluster(id_city)

.                                 sum $dep_var if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "3.258"

.                                 estadd local state_fe "\checkmark": reg_quart_c

.                                 estadd local mayor_municipal "\checkmark": reg_quart_c

.                                 * 2nd quartile
.                                 lincom before + quart2_before

 ( 1)  before + quart2_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .5395537   .7837672     0.69   0.491    -.9991741    2.078282
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2q2 `estimate': reg_quart_c

.                                 estadd local p_valueq2 `p_test': reg_quart_c            

.                                 * 3rd quartile
.                                 lincom before + quart3_before

 ( 1)  before + quart3_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   1.244372   .7230308     1.72   0.086    -.1751152     2.66386
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2q3 `estimate': reg_quart_c

.                                 estadd local p_valueq3 `p_test': reg_quart_c

.                                 * 4th quartile
.                                 lincom before + quart4_before

 ( 1)  before + quart4_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   1.089135   .4898853     2.22   0.027     .1273696      2.0509
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2q4 `estimate': reg_quart_c

.                                 estadd local p_valueq4 `p_test': reg_quart_c                    

. 
. label var before "Before"       

.                 #delimit;
delimiter now ;
.                         esttab reg_broad_basic reg_broad_basic_c reg_broad reg_broad_c reg_fraction reg_fraction_c reg_median reg_median_c reg_quart r
> eg_quart_c
>                         using "tables and figures/table_5.tex", b(3) se compress label star(* 0.10 ** 0.05 *** 0.01) replace
>                         mgroups( "\shortstack{Information \\ disclosure}" "Corruption"   "Share corruption"  "\shortstack{Median \\ Corruption}"   "\s
> hortstack{Quartiles\\ Corruption}"  , pattern(1 0 1 0 1 0 1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) 
>                         keep(before_$corrupt $BEFORE $corrupt corrupt_before fraction_$corrupt median_before above_median_corrupt quartile2 quartile3 
> quartile4 quart2_before quart3_before quart4_before ) 
>                         stats(N mD mayor_municipal state_fe r2_a b0_b2 p_value b0_b2q2 p_valueq2 b0_b2q3 p_valueq3 b0_b2q4 p_valueq4, fmt(%9.0fc %9.3f
> c ) labels("Observations" "Dep. Var. Mean" "Mayor and municipal controls" "State and term FE" "Adjusted R$^2$" "$\beta_0+\beta_2 \, c_{ist}$" "p-value
> " "$\beta_0+\beta_2 \, c_{ist}$ (quartile 2)" "p-value" "$\beta_0+\beta_2 \, c_{ist}$ (quartile 3)" "p-value" "$\beta_0+\beta_2 \, c_{ist}$ (quartile 
> 4)" "p-value"))
>                         /*nonum*/ ar2 booktabs nonotes nomtitles title(deletethis) 
>                         substitute(\begin{table}[htbp]\centering \centering \caption{deletethis} /*\footnotesize*/{ \end{tabular} \end{tabular}} \end{
> table} %);
(output written to tables and figures/table_5.tex)

.                 #delimit cr
delimiter now cr
. restore

. 
.                         
. 
. * Table 6.
. preserve

. keep if sample_camp_exp == 1
(482 observations deleted)

.  
.         global BEFORE before

.         global corrupt broad

.         
.         sum share_vote_margin if sample_camp_exp == 1,d

                     Previous win margin
-------------------------------------------------------------
      Percentiles      Smallest
 1%     .0013988        .000356
 5%     .0074001       .0008467
10%     .0177083        .000947       Obs                 883
25%     .0448913        .000979       Sum of wgt.         883

50%     .0990251                      Mean           .1500011
                        Largest       Std. dev.      .1655142
75%     .1972881              1
90%       .32274              1       Variance       .0273949
95%     .4397358              1       Skewness       2.747289
99%            1              1       Kurtosis       13.01084

.         capture gen above_share_vote_margin = (share_vote_margin > r(p50))  if share_vote_margin ~= . & sample_camp_exp == 1

.         
.         capture gen above_margin = above_share_vote_margin

.         global var_diff above_margin 

.         local reg $var_diff

.         
. foreach num of numlist 0 1  {
  2.         
.         *3. above_median_broad 
.                         eststo `reg'_m_`num': quietly areg camp_exp_pc $BEFORE above_median_corrupt median_before i.term if $var_diff == `num', absorb
> (codigo_uf) robust  cluster(id_city)
  3.                                 sum camp_exp_pc if e(sample), mean 
  4.                                 loc mymean: display %9.3f r(mean)       
  5.                                 estadd local mD `mymean', replace       
  6.                                 estadd local state_fe "\checkmark": `reg'_m_`num'
  7.                                 lincom $BEFORE + median_before
  8.                                 local estimate: display %9.3f r(estimate)
  9.                                 local p_test: display %9.3f r(p)
 10.                                 estadd local b0_b2 `estimate': `reg'_m_`num'
 11.                                 estadd local p_value `p_test': `reg'_m_`num'
 12.                                 
.                 *3.2. above_median_broad + controls
.                         eststo `reg'_m_`num'_c: quietly areg camp_exp_pc $BEFORE above_median_corrupt median_before $muni_controls $mayor_controls i.t
> erm if $var_diff == `num', absorb(codigo_uf) robust  cluster(id_city)
 13.                                 sum camp_exp_pc if e(sample), mean 
 14.                                 loc mymean: display %9.3f r(mean)       
 15.                                 estadd local mD `mymean', replace       
 16.                                 estadd local state_fe "\checkmark": `reg'_m_`num'_c
 17.                                 estadd local mayor_municipal "\checkmark": `reg'_m_`num'_c
 18.                                 lincom $BEFORE + median_before
 19.                                 local estimate: display %9.3f r(estimate)
 20.                                 local p_test: display %9.3f r(p)
 21.                                 estadd local b0_b2 `estimate': `reg'_m_`num'_c
 22.                                 estadd local p_value `p_test': `reg'_m_`num'_c
 23.                          
.                                         
.         *4. quartiles broad     
.                         eststo `reg'_q_`num':   quietly areg camp_exp_pc $BEFORE quartile2 quartile3 quartile4 quart2_before quart3_before quart4_befo
> re i.term i.term if $var_diff == `num', absorb(codigo_uf) robust cluster(id_city)
 24.                                 sum camp_exp_pc if e(sample), mean 
 25.                                 loc mymean: display %9.3f r(mean)       
 26.                                 estadd local mD `mymean', replace       
 27.                                 estadd local state_fe "\checkmark": `reg'_q_`num'
 28.                                 lincom $BEFORE + quart4_before
 29.                                 local estimate: display %9.3f r(estimate)
 30.                                 local p_test: display %9.3f r(p)
 31.                                 estadd local b0_b2 `estimate': `reg'_q_`num'
 32.                                 estadd local p_value `p_test': `reg'_q_`num'
 33. 
.                 *4.2 quartiles broad + controls
.                         eststo `reg'_q_`num'_c: quietly areg camp_exp_pc $BEFORE quartile2 quartile3 quartile4 quart2_before quart3_before quart4_befo
> re $muni_controls $mayor_controls i.term if $var_diff == `num', absorb(codigo_uf) robust  cluster(id_city)
 34.                                 sum camp_exp_pc if e(sample), mean 
 35.                                 loc mymean: display %9.3f r(mean)       
 36.                                 estadd local mD `mymean', replace       
 37.                                 estadd local state_fe "\checkmark": `reg'_q_`num'_c
 38.                                 estadd local mayor_municipal "\checkmark": `reg'_q_`num'_c
 39.                                 lincom $BEFORE + quart4_before
 40.                                 local estimate: display %9.3f r(estimate)
 41.                                 local p_test: display %9.3f r(p)
 42.                                 estadd local b0_b2 `estimate': `reg'_q_`num'_c
 43.                                 estadd local p_value `p_test': `reg'_q_`num'_c
 44. 
. }       

added macro:
                 e(mD) : "2.910"

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |  -.1021261   .4033195    -0.25   0.800    -.8950535    .6908013
------------------------------------------------------------------------------

added macro:
                 e(mD) : "2.910"

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |  -.0353327   .4095622    -0.09   0.931    -.8405334     .769868
------------------------------------------------------------------------------

added macro:
                 e(mD) : "2.910"

 ( 1)  before + quart4_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |  -.0202738   .4984786    -0.04   0.968    -1.000284    .9597367
------------------------------------------------------------------------------

added macro:
                 e(mD) : "2.910"

 ( 1)  before + quart4_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |  -.0169079   .4938394    -0.03   0.973    -.9877978    .9539821
------------------------------------------------------------------------------

added macro:
                 e(mD) : "2.798"

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   1.241883   .4955693     2.51   0.013     .2677024    2.216064
------------------------------------------------------------------------------

added macro:
                 e(mD) : "2.798"

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   1.246821   .5550733     2.25   0.025      .155668    2.337973
------------------------------------------------------------------------------

added macro:
                 e(mD) : "2.798"

 ( 1)  before + quart4_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .9923769   .7393852     1.34   0.180    -.4610926    2.445846
------------------------------------------------------------------------------

added macro:
                 e(mD) : "2.798"

 ( 1)  before + quart4_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .9063721   .7673103     1.18   0.238    -.6019919    2.414736
------------------------------------------------------------------------------

. 
. local reg above_margin 

.                 #delimit;
delimiter now ;
.                         esttab `reg'_m_0 `reg'_m_0_c
>                                    `reg'_q_0 `reg'_q_0_c
>                                    `reg'_m_1 `reg'_m_1_c
>                                    `reg'_q_1 `reg'_q_1_c
>                         using "tables and figures/table_6.tex", b(3) se compress label star(* 0.10 ** 0.05 *** 0.01) replace
>                         mtitles( "Median" "Median" "Quartile"  "Quartile"  "Median"  "Median"  "Quartile"  "Quartile" ) 
>                         keep($BEFORE above_median_corrupt median_before quart2_before quart3_before quart4_before quartile2 quartile3 quartile4)
>                         mgroups( "\shortstack{Weak incumbent\\(head start $\approx$ 0)}"  "\shortstack{Strong Incumbent \\  (head start $>>$ 0)}", pat
> tern(1 0 0 0 1 0 0 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) 
>                         stats(N mD mayor_municipal state_fe r2_a b0_b2 p_value, fmt(%9.0fc %9.3fc ) labels("Observations" "Dep. Var. Mean" "Mayor and 
> municipal controls" "State and term FE" "Adjusted R$^2$" "$\beta_0+\beta_2 \, c_{ist}$" "p-value"))
>                         /*nonum*/ ar2 booktabs nonotes /*nomtitles*/ title(deletethis) 
>                         substitute(\begin{table}[htbp]\centering \centering \caption{deletethis} /*\footnotesize*/{ \end{tabular} \end{tabular}} \end{
> table} %);
(output written to tables and figures/table_6.tex)

.                         #delimit cr
delimiter now cr
. restore

.  
. 
.    
.                         
. * Table 7.
. preserve

. use "data_brasil_camp_chall.dta", clear         

. 
.         global BEFORE before

.         global corrupt broad

.         
.         global var_diff above_margin 

.         local reg $var_diff

. foreach num of numlist 0 1  {
  2.         
.                         eststo `reg'_m_`num':  quietly areg camp_exp_pc $BEFORE above_median_corrupt median_before i.term if $var_diff == `num', absor
> b(codigo_uf) robust  cluster(id_city)
  3.                                 sum camp_exp_pc if e(sample), mean 
  4.                                 loc mymean: display %9.3f r(mean)       
  5.                                 estadd local mD `mymean', replace       
  6.                                 estadd local state_fe "\checkmark": `reg'_m_`num'
  7.                                 lincom $BEFORE + median_before
  8.                                 local estimate: display %9.3f r(estimate)
  9.                                 local p_test: display %9.3f r(p)
 10.                                 estadd local b0_b2 `estimate': `reg'_m_`num'
 11.                                 estadd local p_value `p_test': `reg'_m_`num'
 12.                                                         
.                         eststo `reg'_m_`num'_c:  quietly areg camp_exp_pc $BEFORE above_median_corrupt median_before $muni_controls $challenger_contro
> ls i.term if $var_diff == `num', absorb(codigo_uf) robust  cluster(id_city)
 13.                                 sum camp_exp_pc if e(sample), mean 
 14.                                 loc mymean: display %9.3f r(mean)       
 15.                                 estadd local mD `mymean', replace       
 16.                                 estadd local state_fe "\checkmark": `reg'_m_`num'_c
 17.                                 estadd local mayor_municipal "\checkmark": `reg'_m_`num'_c
 18.                                 lincom $BEFORE + median_before
 19.                                 local estimate: display %9.3f r(estimate)
 20.                                 local p_test: display %9.3f r(p)
 21.                                 estadd local b0_b2 `estimate': `reg'_m_`num'_c
 22.                                 estadd local p_value `p_test': `reg'_m_`num'_c
 23.          
.                         eststo `reg'_q_`num':  quietly areg camp_exp_pc $BEFORE quartile2 quartile3 quartile4 quart2_before quart3_before quart4_befor
> e i.term if $var_diff == `num', absorb(codigo_uf) robust cluster(id_city)
 24.                                 sum camp_exp_pc if e(sample), mean 
 25.                                 loc mymean: display %9.3f r(mean)       
 26.                                 estadd local mD `mymean', replace       
 27.                                 estadd local state_fe "\checkmark": `reg'_q_`num'
 28.                                 lincom $BEFORE + quart4_before
 29.                                 local estimate: display %9.3f r(estimate)
 30.                                 local p_test: display %9.3f r(p)
 31.                                 estadd local b0_b2 `estimate': `reg'_q_`num'
 32.                                 estadd local p_value `p_test': `reg'_q_`num'
 33. 
.                         eststo `reg'_q_`num'_c: quietly areg camp_exp_pc $BEFORE quartile2 quartile3 quartile4 quart2_before quart3_before quart4_befo
> re $muni_controls $challenger_controls i.term if $var_diff == `num', absorb(codigo_uf) robust  cluster(id_city)
 34.                                 sum camp_exp_pc if e(sample), mean 
 35.                                 loc mymean: display %9.3f r(mean)       
 36.                                 estadd local mD `mymean', replace       
 37.                                 estadd local state_fe "\checkmark": `reg'_q_`num'_c
 38.                                 estadd local mayor_municipal "\checkmark": `reg'_q_`num'_c
 39.                                 lincom $BEFORE + quart4_before
 40.                                 local estimate: display %9.3f r(estimate)
 41.                                 local p_test: display %9.3f r(p)
 42.                                 estadd local b0_b2 `estimate': `reg'_q_`num'_c
 43.                                 estadd local p_value `p_test': `reg'_q_`num'_c
 44. 
. }       

added macro:
                 e(mD) : "3.470"

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |    1.32319   .6510905     2.03   0.043      .042795    2.603585
------------------------------------------------------------------------------

added macro:
                 e(mD) : "3.470"

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   1.369921   .6328459     2.16   0.031     .1254054    2.614437
------------------------------------------------------------------------------

added macro:
                 e(mD) : "3.470"

 ( 1)  before + quart4_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .9801951   .7203774     1.36   0.174    -.4364549    2.396845
------------------------------------------------------------------------------

added macro:
                 e(mD) : "3.470"

 ( 1)  before + quart4_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .8847899   .7316747     1.21   0.227    -.5540767    2.323657
------------------------------------------------------------------------------

added macro:
                 e(mD) : "3.049"

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   1.065025   .4753641     2.24   0.026      .130375    1.999675
------------------------------------------------------------------------------

added macro:
                 e(mD) : "3.049"

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .9856656   .5090727     1.94   0.054    -.0152615    1.986593
------------------------------------------------------------------------------

added macro:
                 e(mD) : "3.049"

 ( 1)  before + quart4_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   1.219233    .615597     1.98   0.048     .0088602    2.429606
------------------------------------------------------------------------------

added macro:
                 e(mD) : "3.049"

 ( 1)  before + quart4_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   1.242417   .6690061     1.86   0.064    -.0729675    2.557801
------------------------------------------------------------------------------

. 
. 
. capture label var before_broad "Before $\times$ corruption"

. capture label var broad "Corruption"

. 
. capture label var corrupt_before "Before $\times$ share corruption"

. capture label var fraction_broad "Share corruption"

. 
. 
. label var before "Before"

. local reg above_margin 

.                 #delimit;
delimiter now ;
.                         esttab `reg'_m_0 `reg'_m_0_c
>                                    `reg'_q_0 `reg'_q_0_c
>                                    `reg'_m_1 `reg'_m_1_c
>                                    `reg'_q_1 `reg'_q_1_c
>                         using "tables and figures/table_7.tex", b(3) se compress label star(* 0.10 ** 0.05 *** 0.01) replace
>                         mtitles( "Median" "Median" "Quartile"  "Quartile"  "Median"  "Median"  "Quartile"  "Quartile") 
>                         keep($BEFORE above_median_corrupt median_before quart2_before quart3_before quart4_before quartile2 quartile3 quartile4)
>                         mgroups( "\shortstack{Against weak incumbent\\(head start $\approx$ 0)}"  "\shortstack{Against strong incumbent \\  (head star
> t $>>$ 0)}", pattern(1 0 0 0 1 0 0 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) 
>                         stats(N mD mayor_municipal state_fe r2_a b0_b2 p_value, fmt(%9.0fc %9.3fc ) labels("Observations" "Dep. Var. Mean" "Mayor and 
> municipal controls" "State and term FE" "Adjusted R$^2$" "$\beta_0+\beta_2 \, c_{ist}$" "p-value"))
>                         /*nonum*/ ar2 booktabs nonotes /*nomtitles*/ title(deletethis) 
>                         substitute(\begin{table}[htbp]\centering \centering \caption{deletethis} /*\footnotesize*/{ \end{tabular} \end{tabular}} \end{
> table} %);
(output written to tables and figures/table_7.tex)

.                                 #delimit cr
delimiter now cr
. 
. restore

.                 
.                 
. * Table 8.
.         global BEFORE before

.         global corrupt broad

. 
. * Bolsa Familia
.         local Other_reg "bolsa_pc valor"

.                 
.         foreach dep_var of varlist `Other_reg' {
  2.             
.                         eststo m_c_`dep_var': quietly areg `dep_var' $BEFORE above_median_corrupt median_before $muni_controls $mayor_controls i.term,
>  absorb(codigo_uf) robust  cluster(id_city)
  3.                                 sum `dep_var' if e(sample), mean 
  4.                                 loc mymean: display %9.3f r(mean)       
  5.                                 estadd local mD `mymean', replace       
  6.                                 estadd local state_fe "\checkmark": m_c_`dep_var'
  7.                                 estadd local mayor_municipal "\checkmark": m_c_`dep_var'
  8.                                 lincom $BEFORE + median_before
  9.                                 local estimate: display %9.3f r(estimate)
 10.                                 local p_test: display %9.3f r(p)
 11.                                 estadd local b0_b2 `estimate': m_c_`dep_var'
 12.                                 estadd local p_value `p_test': m_c_`dep_var'
 13.         
.                         eststo q_c_`dep_var': quietly areg `dep_var' $BEFORE quartile2 quartile3 quartile4 quart2_before quart3_before quart4_before $
> muni_controls $mayor_controls i.term , absorb(codigo_uf) robust  cluster(id_city)
 14.                                 sum `dep_var' if e(sample), mean 
 15.                                 loc mymean: display %9.3f r(mean)       
 16.                                 estadd local mD `mymean', replace       
 17.                                 estadd local state_fe "\checkmark": q_c_`dep_var'
 18.                                 estadd local mayor_municipal "\checkmark": q_c_`dep_var'
 19.                                 lincom $BEFORE + quart4_before
 20.                                 local estimate: display %9.3f r(estimate)
 21.                                 local p_test: display %9.3f r(p)
 22.                                 estadd local b0_b2 `estimate': q_c_`dep_var'
 23.                                 estadd local p_value `p_test': q_c_`dep_var'                                                            
 24.         }

added macro:
                 e(mD) : "6.785"

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
    bolsa_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .2392416   .1774919     1.35   0.178    -.1090233    .5875064
------------------------------------------------------------------------------

added macro:
                 e(mD) : "6.785"

 ( 1)  before + quart4_before = 0

------------------------------------------------------------------------------
    bolsa_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .4262243   .2429651     1.75   0.080    -.0505084     .902957
------------------------------------------------------------------------------

added macro:
                 e(mD) : "31.041"

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
       valor | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .0519701   .2352073     0.22   0.825    -.4095406    .5134809
------------------------------------------------------------------------------

added macro:
                 e(mD) : "31.041"

 ( 1)  before + quart4_before = 0

------------------------------------------------------------------------------
       valor | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |  -.2176559   .3410283    -0.64   0.523    -.8868027    .4514909
------------------------------------------------------------------------------

.         
. *  Public Employment
. preserve

. capture gen Before_1 = before_1

.         replace Before_1 = 1 if Before_1 == 0 &  lottery == 25 & term ==2005 /* lotteria con fecha 09oct2007. 1 year antes*/
(40 real changes made)

.         label var Before_1 "Lottery occurred before the year previous of the election."

. 
.         replace before = Before_1
(61 real changes made)

.         
.         global BEFORE before

.         global corrupt broad

.         
.         local Other_reg "empl_perm_pc empl_trans_pc"

.                 
.         foreach dep_var of varlist `Other_reg' {
  2.                     
.                         eststo m_c_`dep_var': quietly areg `dep_var' $BEFORE above_median_corrupt median_before $muni_controls $mayor_controls i.term,
>  absorb(codigo_uf) robust  cluster(id_city)
  3.                                 sum `dep_var' if e(sample), mean 
  4.                                 loc mymean: display %9.3f r(mean)       
  5.                                 estadd local mD `mymean', replace       
  6.                                 estadd local state_fe "\checkmark": m_c_`dep_var'
  7.                                 estadd local mayor_municipal "\checkmark": m_c_`dep_var'
  8.                                 lincom $BEFORE + median_before
  9.                                 local estimate: display %9.3f r(estimate)
 10.                                 local p_test: display %9.3f r(p)
 11.                                 estadd local b0_b2 `estimate': m_c_`dep_var'
 12.                                 estadd local p_value `p_test': m_c_`dep_var'
 13.         
.                         eststo q_c_`dep_var': quietly areg `dep_var' $BEFORE quartile2 quartile3 quartile4 quart2_before quart3_before quart4_before $
> muni_controls $mayor_controls i.term , absorb(codigo_uf) robust  cluster(id_city)
 14.                                 sum `dep_var' if e(sample), mean 
 15.                                 loc mymean: display %9.3f r(mean)       
 16.                                 estadd local mD `mymean', replace       
 17.                                 estadd local state_fe "\checkmark": q_c_`dep_var'
 18.                                 estadd local mayor_municipal "\checkmark": q_c_`dep_var'
 19.                                 lincom $BEFORE + quart4_before
 20.                                 local estimate: display %9.3f r(estimate)
 21.                                 local p_test: display %9.3f r(p)
 22.                                 estadd local b0_b2 `estimate': q_c_`dep_var'
 23.                                 estadd local p_value `p_test': q_c_`dep_var'                                                            
 24.         }

added macro:
                 e(mD) : "3.035"

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
empl_perm_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |    .035704   .1137886     0.31   0.754     -.187565    .2589729
------------------------------------------------------------------------------

added macro:
                 e(mD) : "3.035"

 ( 1)  before + quart4_before = 0

------------------------------------------------------------------------------
empl_perm_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |  -.1106923   .1615068    -0.69   0.493    -.4275911    .2062066
------------------------------------------------------------------------------

added macro:
                 e(mD) : "0.973"

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
empl_trans~c | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   -.022518   .0954546    -0.24   0.814    -.2098132    .1647771
------------------------------------------------------------------------------

added macro:
                 e(mD) : "0.973"

 ( 1)  before + quart4_before = 0

------------------------------------------------------------------------------
empl_trans~c | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |  -.0028294    .143753    -0.02   0.984    -.2848928     .279234
------------------------------------------------------------------------------

.         
. restore

.         
.   eststo dir

--------------------------------------------------------------------------------------
             |           Dependent  Number of        
        Name | Command    variable     param.  Title 
-------------+------------------------------------------------------------------------
reg_broad_~c | areg      camp_exp_pc        4  Linear regression, absorbing indicators
reg_broad_~c | areg      camp_exp_pc       15  Linear regression, absorbing indicators
   reg_broad | areg      camp_exp_pc        6  Linear regression, absorbing indicators
 reg_broad_c | areg      camp_exp_pc       17  Linear regression, absorbing indicators
reg_fraction | areg      camp_exp_pc        6  Linear regression, absorbing indicators
reg_fracti~c | areg      camp_exp_pc       17  Linear regression, absorbing indicators
  reg_median | areg      camp_exp_pc        6  Linear regression, absorbing indicators
reg_median_c | areg      camp_exp_pc       17  Linear regression, absorbing indicators
   reg_quart | areg      camp_exp_pc       10  Linear regression, absorbing indicators
 reg_quart_c | areg      camp_exp_pc       21  Linear regression, absorbing indicators
above_marg~0 | areg      camp_exp_pc        6  Linear regression, absorbing indicators
above_marg~c | areg      camp_exp_pc       17  Linear regression, absorbing indicators
above_marg~0 | areg      camp_exp_pc       10  Linear regression, absorbing indicators
above_marg~c | areg      camp_exp_pc       21  Linear regression, absorbing indicators
above_marg~1 | areg      camp_exp_pc        6  Linear regression, absorbing indicators
above_marg~c | areg      camp_exp_pc       17  Linear regression, absorbing indicators
above_marg~1 | areg      camp_exp_pc       10  Linear regression, absorbing indicators
above_marg~c | areg      camp_exp_pc       21  Linear regression, absorbing indicators
m_c_bolsa_pc | areg       bolsa_pc         18  Linear regression, absorbing indicators
q_c_bolsa_pc | areg       bolsa_pc         22  Linear regression, absorbing indicators
   m_c_valor | areg          valor         18  Linear regression, absorbing indicators
   q_c_valor | areg          valor         22  Linear regression, absorbing indicators
m_c_empl_p~c | areg      empl_perm_pc      18  Linear regression, absorbing indicators
q_c_empl_p~c | areg      empl_perm_pc      22  Linear regression, absorbing indicators
m_c_empl_t~c | areg      empl_trans~c      18  Linear regression, absorbing indicators
q_c_empl_t~c | areg      empl_trans~c      22  Linear regression, absorbing indicators
--------------------------------------------------------------------------------------

.           
.                 #delimit;
delimiter now ;
.                 esttab 
>                         m_c_bolsa_pc q_c_bolsa_pc m_c_valor q_c_valor 
>                         m_c_empl_perm_pc q_c_empl_perm_pc m_c_empl_trans_pc q_c_empl_trans_pc
>                         using "tables and figures\table_8.tex", b(3) se compress label star(* 0.10 ** 0.05 *** 0.01) replace
>                         mtitles( "Median" "Quartile"  "Median" "Quartile" "Median" "Quartile" "Median" "Quartile") 
>                         mgroups( "\shortstack{Beneficiary families \\(\% population)}"   "Value of benefits" "Permanent employees" "Transitory employe
> es"  , pattern(1 0 1 0 1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) 
>                         keep($BEFORE above_median_corrupt median_before 
>                                  quart2_before quart3_before quart4_before quartile2 quartile3 quartile4)
>                         stats(N mD r2_a b0_b2 p_value, fmt(%9.0fc %9.3fc ) labels("Observations" "Dep. Var. Mean" "Adjusted R$^2$" "$\beta_0+\beta_2 \
> , c_{ist}$" "p-value"))
>                         /*nonum*/ ar2 booktabs nonotes /*nomtitles*/ title(deletethis) 
>                         substitute(\begin{table}[htbp]\centering \centering \caption{deletethis} /*\footnotesize*/{ \end{tabular} \end{tabular}} \end{
> table} %);
(output written to tables and figures\table_8.tex)

.                         #delimit cr
delimiter now cr
. 
. eststo clear    

. 
end of do-file
C:\Users\75618rpo\Dropbox\Research\Literature Latex\Corruption, accountability and voting\Submission R&R JoP\Replication\replication_package_JOP

. * APPENDIX C
. cd "C:\Users\75618rpo\Dropbox\Research\Literature Latex\Corruption, accountability and voting\Submission R&R JoP\Replication\replication_package_JOP"
C:\Users\75618rpo\Dropbox\Research\Literature Latex\Corruption, accountability and voting\Submission R&R JoP\Replication\replication_package_JOP

.         global muni_controls lpib_pc gini illiteracy share_urb radio_am         

.         global mayor_controls male married age education prev_mayor share_vote_margin dum_PT            

.         global challenger_controls male married age education prev_mayor dum_PT

.         global cluster id_city

. 
.         global size_column "{p{5cm}p{1cm}p{1cm}p{1cm}p{1cm}p{1.5cm}p{1.5cm}c}"

.         global format_table "vce(cluster $cluster) wide(mean1 sd1 mean2 sd2 diff pval) pvalues varlabels  format(%9.2f) nostars nonumbers noobservatio
> ns nolines"

.         
. * Table C1
.         use "data_brasil_camp.dta", clear

.         tabstat camp_exp_pc if sample_camp_exp == 1, s(mean sd p25 median p75 p99 max) c(s) format (%6.2f)

    Variable |      Mean        SD       p25       p50       p75       p99       Max
-------------+----------------------------------------------------------------------
 camp_exp_pc |      2.87      3.49      1.01      1.91      3.64     15.37     52.37
------------------------------------------------------------------------------------

.  
.         use "data_brasil_camp_chall.dta", clear

.         tabstat camp_exp_pc if sample_camp_exp_chal == 1, s(mean sd p25 median p75 p99 max) c(s) format (%6.2f)

    Variable |      Mean        SD       p25       p50       p75       p99       Max
-------------+----------------------------------------------------------------------
 camp_exp_pc |      3.27      3.90      1.00      2.08      4.16     16.60     44.03
------------------------------------------------------------------------------------

.                         
.         
. * Table C.2.
. use "data_brasil_camp.dta", clear

. 
. preserve

.         replace radio_am = 100 if radio_am == 1 /*so it is in %*/
(335 real changes made)

.         
.         balancetable before broad fraction_broad using "tables and figures/table_c2a.tex", $format_table replace prehead("\begin{tabularx}{\linewidth}
>  $size_column \textit{A. Reputation shocks} \\") postfoot("\end{tabularx}") 

.         
.         balancetable before $mayor_controls using "tables and figures/table_c2b.tex", $format_table replace prehead("\begin{tabularx}{\linewidth}  $si
> ze_column {\textit{B. Mayor characteristics}} \\") postfoot("\end{tabularx}") 

. 
.         balancetable before $muni_controls using "tables and figures/table_c2c.tex", $format_table replace prehead("\begin{tabularx}{\linewidth} $size
> _column {\textit{C. Municipal characteristics}} \\") postfoot("\end{tabularx}")   

. restore

. 
. 
. * Table C.3
. preserve

.         keep if sample_camp_exp == 1 & above_median_corrupt == 1
(938 observations deleted)

.         replace radio_am = 100 if radio_am == 1 
(104 real changes made)

.                 
.         balancetable before $mayor_controls using "tables and figures/table_c3a.tex", $format_table replace prehead("\begin{tabularx}{\linewidth}  $si
> ze_column {\textit{A. Mayor characteristics}} \\") postfoot("\end{tabularx}") 

. 
.         balancetable before $muni_controls using "tables and figures/table_c3b.tex", $format_table replace prehead("\begin{tabularx}{\linewidth} $size
> _column {\textit{B. Municipal characteristics}} \\") postfoot("\end{tabularx}")   

. restore

. 
. * Table C.4
. preserve

.         keep if sample_camp_exp == 1 & above_median_corrupt == 0
(956 observations deleted)

.         replace radio_am = 100 if radio_am == 1 
(97 real changes made)

.         
.         balancetable before $mayor_controls using "tables and figures/table_c4a.tex", $format_table replace prehead("\begin{tabularx}{\linewidth}  $si
> ze_column {\textit{A. Mayor characteristics}} \\") postfoot("\end{tabularx}") 

. 
.         balancetable before $muni_controls using "tables and figures/table_c4b.tex", $format_table replace prehead("\begin{tabularx}{\linewidth} $size
> _column {\textit{B. Municipal characteristics}} \\") postfoot("\end{tabularx}")   

. restore 

. 
. * Table C.5 
. preserve

. use "data_brasil_camp_chall.dta", clear

. 
.         keep if sample_camp_exp_chal == 1 & above_median_corrupt == 1
(449 observations deleted)

.         replace radio_am = 100 if radio_am == 1 
(97 real changes made)

.                 
.         balancetable before $challenger_controls using "tables and figures/table_c5a.tex", $format_table replace prehead("\begin{tabularx}{\linewidth}
>   $size_column {\textit{A. Challenger characteristics}} \\") postfoot("\end{tabularx}") 

. 
.         balancetable before $muni_controls using "tables and figures/table_c5b.tex", $format_table replace prehead("\begin{tabularx}{\linewidth} $size
> _column {\textit{B. Municipal characteristics}} \\") postfoot("\end{tabularx}")   

.         
. restore

. 
. 
. * Table C.6 
. preserve

. use "data_brasil_camp_chall.dta", clear

. 
.         keep if sample_camp_exp_chal == 1 & above_median_corrupt == 0
(445 observations deleted)

.         replace radio_am = 100 if radio_am == 1 
(96 real changes made)

.                 
.         balancetable before $challenger_controls using "tables and figures/table_c6a.tex", $format_table replace prehead("\begin{tabularx}{\linewidth}
>   $size_column {\textit{A. Challenger characteristics}} \\") postfoot("\end{tabularx}") 

. 
.         balancetable before $muni_controls using "tables and figures/table_c6b.tex", $format_table replace prehead("\begin{tabularx}{\linewidth} $size
> _column {\textit{B. Municipal characteristics}} \\") postfoot("\end{tabularx}")   

.         
. restore

. 
. 
. 
. * Table C.7
. use "data_brasil_camp.dta", clear

. 
. * incumbent
. gen before_gini = before * gini

. gen before_lpib_pc = before * lpib_pc

. gen before_illiteracy = before * illiteracy

. 
.         label var before_gini "Before $\times$ gini"

.         label var before_lpib_pc "Before $\times$ income"

.         label var before_illiteracy "Before $\times$ illiteracy"

.         
. eststo clear    

. 
.                 * gini
.                 eststo reg_median_c_gini: quietly areg camp_exp_pc before above_median_corrupt median_before before_gini $muni_controls $mayor_control
> s i.term, absorb(codigo_uf) robust  cluster($cluster)

.                                 sum camp_exp_pc if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "2.854"

.                                 estadd local state_fe "\checkmark": reg_median_c_gini

.                                 estadd local mayor_municipal "\checkmark": reg_median_c_gini

.                                 lincom before + median_before

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |  -1.395371   1.723795    -0.81   0.418    -4.779197    1.988455
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': reg_median_c_gini

.                                 estadd local p_value `p_test': reg_median_c_gini

. 
.                 * pib
.                 eststo reg_median_c_pib: quietly areg camp_exp_pc before above_median_corrupt median_before before_lpib_pc $muni_controls $mayor_contr
> ols i.term, absorb(codigo_uf) robust  cluster($cluster)

.                                 sum camp_exp_pc if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "2.854"

.                                 estadd local state_fe "\checkmark": reg_median_c_pib

.                                 estadd local mayor_municipal "\checkmark": reg_median_c_pib

.                                 lincom before + median_before

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |    1.06171   2.351742     0.45   0.652    -3.554784    5.678203
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': reg_median_c_pib

.                                 estadd local p_value `p_test': reg_median_c_pib

.                 
.                 * illiteracy
.                 eststo reg_median_c_illi: quietly areg camp_exp_pc before above_median_corrupt median_before before_illiteracy $muni_controls $mayor_c
> ontrols i.term, absorb(codigo_uf) robust  cluster($cluster)

.                                 sum camp_exp_pc if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "2.854"

.                                 estadd local state_fe "\checkmark": reg_median_c_illi

.                                 estadd local mayor_municipal "\checkmark": reg_median_c_illi

.                                 lincom before + median_before

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .2340867   .6597469     0.35   0.723    -1.061003    1.529176
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': reg_median_c_illi

.                                 estadd local p_value `p_test': reg_median_c_illi

.                                 
.                 * all
.                 eststo reg_median_c_all: quietly areg camp_exp_pc before above_median_corrupt median_before before_gini before_lpib_pc before_illitera
> cy $muni_controls $mayor_controls i.term, absorb(codigo_uf) robust  cluster($cluster)

.                                 sum camp_exp_pc if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "2.854"

.                                 estadd local state_fe "\checkmark": reg_median_c_all

.                                 estadd local mayor_municipal "\checkmark": reg_median_c_all

.                                 lincom before + median_before

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |  -3.541676   5.096722    -0.69   0.487    -13.54659    6.463241
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': reg_median_c_all

.                                 estadd local p_value `p_test': reg_median_c_all

.                                                                                 
.                                                                                 
. 
. * challenger
. preserve

. 
. use "data_brasil_camp_chall.dta", clear

.         
.                 * gini
.                 eststo reg_median_c_gini_chal: quietly areg camp_exp_pc before above_median_corrupt median_before before_gini $muni_controls $challeng
> er_controls i.term, absorb(codigo_uf) robust  cluster($cluster)

.                                 sum camp_exp_pc if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "3.258"

.                                 estadd local state_fe "\checkmark": reg_median_c_gini_chal

.                                 estadd local mayor_municipal "\checkmark": reg_median_c_gini_chal

.                                 lincom before + median_before

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |  -.4987975   2.234781    -0.22   0.823    -4.886223    3.888628
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': reg_median_c_gini_chal

.                                 estadd local p_value `p_test': reg_median_c_gini_chal

. 
.                 * pib
.                 eststo reg_median_c_pib_chal: quietly areg camp_exp_pc before above_median_corrupt median_before before_lpib_pc $muni_controls $challe
> nger_controls i.term, absorb(codigo_uf) robust  cluster($cluster)

.                                 sum camp_exp_pc if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "3.258"

.                                 estadd local state_fe "\checkmark": reg_median_c_pib_chal

.                                 estadd local mayor_municipal "\checkmark": reg_median_c_pib_chal

.                                 lincom before + median_before

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .6543519   2.258961     0.29   0.772    -3.780545    5.089248
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': reg_median_c_pib_chal

.                                 estadd local p_value `p_test': reg_median_c_pib_chal

.                 
.                 * illiteracy
.                 eststo reg_median_c_illi_chal: quietly areg camp_exp_pc before above_median_corrupt median_before before_illiteracy $muni_controls $ch
> allenger_controls i.term, absorb(codigo_uf) robust  cluster($cluster)

.                                 sum camp_exp_pc if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "3.258"

.                                 estadd local state_fe "\checkmark": reg_median_c_illi_chal

.                                 estadd local mayor_municipal "\checkmark": reg_median_c_illi_chal

.                                 lincom before + median_before

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .8922062   .6740957     1.32   0.186    -.4312096    2.215622
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': reg_median_c_illi_chal

.                                 estadd local p_value `p_test': reg_median_c_illi_chal

.                                 
.                 * all
.                 eststo reg_median_c_all_chal: quietly areg camp_exp_pc before above_median_corrupt median_before before_gini before_lpib_pc before_ill
> iteracy $muni_controls $challenger_controls i.term, absorb(codigo_uf) robust  cluster($cluster)

.                                 sum camp_exp_pc if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "3.258"

.                                 estadd local state_fe "\checkmark": reg_median_c_all_chal

.                                 estadd local mayor_municipal "\checkmark": reg_median_c_all_chal

.                                 lincom before + median_before

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |  -6.306577   5.719637    -1.10   0.271    -17.53563    4.922478
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': reg_median_c_all_chal

.                                 estadd local p_value `p_test': reg_median_c_all_chal

.                                                                                 
.                                                                                 
. restore                                                                 

.                                 
. 
.         
. * EXPORT TABLE TO LATEX         
.                 #delimit;
delimiter now ;
.                         esttab reg_median_c_gini reg_median_c_pib reg_median_c_illi reg_median_c_all
>                                         reg_median_c_gini_chal reg_median_c_pib_chal reg_median_c_illi_chal reg_median_c_all_chal
>                         using "tables and figures/table_c7.tex", b(3) se compress label star(* 0.10 ** 0.05 *** 0.01) replace
>                         keep(before median_before above_median_corrupt before_gini before_lpib_pc before_illiteracy  ) 
>                         /*scalars("mayor_municipal Mayor and municipal controls" "state_fe State fixed effects")  */
>                         mgroups( "Incumbent"   "Challenger"  , pattern(1 0 0 0 1 0 0 0 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmid
> rule(lr){@span})) 
>                         stats(N mD mayor_municipal state_fe r2_a b0_b2 p_value, fmt(%9.0fc %9.3fc ) labels("Observations" "Dep. Var. Mean" "Mayor and 
> municipal controls" "State and term FE" "Adjusted R$^2$" "$\beta_0+\beta_2 \, c_{ist}$" "p-value"))
>                         /*nonum*/ ar2 booktabs nonotes nomtitles title(deletethis) 
>                         substitute(\begin{table}[htbp]\centering \centering \caption{deletethis} /*\footnotesize*/{ \end{tabular} \end{tabular}} \end{
> table} %);
(output written to tables and figures/table_c7.tex)

.                 #delimit cr
delimiter now cr
.                         
. 
. 
.                         
. * Table C.8 
. capture gen before_male = before * male

. capture gen before_married = before * married

. capture gen before_age = before * age

. capture gen before_education = before * education

. capture gen before_prev_mayor = before * prev_mayor

. 
.         label var before_male "Before $\times$ Male"

.         label var before_married "Before $\times$ Married"      

.         label var before_age "Before $\times$ Age"

.         label var before_education "Before $\times$ Education"

.         label var before_prev_mayor "Before $\times$ Previous Mayor"

.         
. eststo clear    

.                 * male
.                 eststo reg_median_c_male: quietly areg camp_exp_pc before above_median_corrupt median_before before_male $muni_controls $mayor_control
> s i.term, absorb(codigo_uf) robust  cluster($cluster)

.                                 sum camp_exp_pc if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "2.854"

.                                 estadd local state_fe "\checkmark": reg_median_c_male

.                                 estadd local mayor_municipal "\checkmark": reg_median_c_male

.                                 lincom before + median_before

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   1.134127   .8292403     1.37   0.172    -.4936797    2.761935
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': reg_median_c_male

.                                 estadd local p_value `p_test': reg_median_c_male

. 
.                 * married
.                 eststo reg_median_c_married: quietly areg camp_exp_pc before above_median_corrupt median_before before_married $muni_controls $mayor_c
> ontrols i.term, absorb(codigo_uf) robust  cluster($cluster)

.                                 sum camp_exp_pc if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "2.854"

.                                 estadd local state_fe "\checkmark": reg_median_c_married

.                                 estadd local mayor_municipal "\checkmark": reg_median_c_married

.                                 lincom before + median_before

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .4992582   .6024072     0.83   0.407    -.6832732     1.68179
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': reg_median_c_married

.                                 estadd local p_value `p_test': reg_median_c_married                             

.                                 
.                 * age
.                 eststo reg_median_c_age: quietly areg camp_exp_pc before above_median_corrupt median_before before_age $muni_controls $mayor_controls 
> i.term, absorb(codigo_uf) robust  cluster($cluster)

.                                 sum camp_exp_pc if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "2.854"

.                                 estadd local state_fe "\checkmark": reg_median_c_age

.                                 estadd local mayor_municipal "\checkmark": reg_median_c_age

.                                 lincom before + median_before

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |  -1.402491   1.219139    -1.15   0.250    -3.795672    .9906906
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': reg_median_c_age

.                                 estadd local p_value `p_test': reg_median_c_age

.                 
.                 * Education
.                 eststo reg_median_c_educ: quietly areg camp_exp_pc before above_median_corrupt median_before before_education $muni_controls $mayor_co
> ntrols i.term, absorb(codigo_uf) robust  cluster($cluster)

.                                 sum camp_exp_pc if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "2.854"

.                                 estadd local state_fe "\checkmark": reg_median_c_educ

.                                 estadd local mayor_municipal "\checkmark": reg_median_c_educ

.                                 lincom before + median_before

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .1030492   .9161311     0.11   0.910    -1.695325    1.901424
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': reg_median_c_educ

.                                 estadd local p_value `p_test': reg_median_c_educ

.                                 
.                 * Previous Mayor
.                 eststo reg_median_c_prev_may: quietly areg camp_exp_pc before above_median_corrupt median_before before_prev_mayor $muni_controls $may
> or_controls i.term, absorb(codigo_uf) robust  cluster($cluster)

.                                 sum camp_exp_pc if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "2.854"

.                                 estadd local state_fe "\checkmark": reg_median_c_prev_may

.                                 estadd local mayor_municipal "\checkmark": reg_median_c_prev_may

.                                 lincom before + median_before

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .5577031   .3160886     1.76   0.078    -.0627819    1.178188
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': reg_median_c_prev_may

.                                 estadd local p_value `p_test': reg_median_c_prev_may

.                                                                                 
.                 * All
.                 eststo reg_median_c_may_all: quietly areg camp_exp_pc before above_median_corrupt median_before before_male before_married before_age 
> before_education before_prev_mayor $muni_controls $mayor_controls i.term, absorb(codigo_uf) robust  cluster($cluster)

.                                 sum camp_exp_pc if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "2.854"

.                                 estadd local state_fe "\checkmark": reg_median_c_may_all

.                                 estadd local mayor_municipal "\checkmark": reg_median_c_may_all

.                                 lincom before + median_before

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |  -1.680825   2.060312    -0.82   0.415    -5.725238    2.363587
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': reg_median_c_may_all

.                                 estadd local p_value `p_test': reg_median_c_may_all

. 
.                 #delimit;
delimiter now ;
.                         esttab  reg_median_c_male reg_median_c_married reg_median_c_age reg_median_c_educ reg_median_c_prev_may reg_median_c_may_all
>                         using "tables and figures/table_c8.tex", b(3) se compress label star(* 0.10 ** 0.05 *** 0.01) replace
>                         keep(before median_before above_median_corrupt before_male before_married before_age before_education before_prev_mayor ) 
>                         mgroups( "Incumbent"  , pattern(1 0 0 0 0 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) 
>                         stats(N mD mayor_municipal state_fe r2_a b0_b2 p_value, fmt(%9.0fc %9.3fc ) labels("Observations" "Dep. Var. Mean" "Mayor and 
> municipal controls" "State and term FE" "Adjusted R$^2$" "$\beta_0+\beta_2 \, c_{ist}$" "p-value"))
>                         /*nonum*/ ar2 booktabs nonotes nomtitles title(deletethis) 
>                         substitute(\begin{table}[htbp]\centering \centering \caption{deletethis} /*\footnotesize*/{ \end{tabular} \end{tabular}} \end{
> table} %);
(output written to tables and figures/table_c8.tex)

.                 #delimit cr
delimiter now cr
. 
. * Table C9
.         tabstat month0_3 month3_12 month12_n, by(term) statistics(sum) format(%9.0f)      

Summary statistics: Sum
Group variable: term (Mayoral Term)

    term |  month0_3  month~12  month1~n
---------+------------------------------
    2001 |        61       123        44
    2005 |         0       127       269
---------+------------------------------
   Total |        61       250       313
----------------------------------------

.         gen after = 1-before

.         label var after "After the election"

. 
.         eststo clear    

.         bysort term: eststo: estpost summarize month0_3 month3_12 month12_n after if camp_exp_pc !=., listwise 

--------------------------------------------------------------------------------------------------------------------------------------------------------
-> 2001

             |  e(count)   e(sum_w)    e(mean)     e(Var)      e(sd)     e(min)     e(max)     e(sum) 
-------------+----------------------------------------------------------------------------------------
    month0_3 |       455        455   .0747253   .0692937    .263237          0          1         34 
   month3_12 |       455        455    .156044   .1319843   .3632965          0          1         71 
   month12_n |       455        455    .043956   .0421165    .205223          0          1         20 
       after |       455        455   .7252747   .1996902   .4468671          0          1        330 
(est1 stored)

--------------------------------------------------------------------------------------------------------------------------------------------------------
-> 2005

             |  e(count)   e(sum_w)    e(mean)     e(Var)      e(sd)     e(min)     e(max)     e(sum) 
-------------+----------------------------------------------------------------------------------------
    month0_3 |       428        428          0          0          0          0          0          0 
   month3_12 |       428        428   .2359813   .1807164   .4251075          0          1        101 
   month12_n |       428        428   .4579439   .2488126   .4988112          0          1        196 
       after |       428        428   .3060748   .2128904   .4614005          0          1        131 
(est2 stored)

.         esttab using "tables and figures\table_c9.tex", cells("sum(fmt(0))   mean(fmt(3))  ") label nodepvar /*
>         */ mgroups( "Term 2001-2004"   "Term 2005-2008"  , pattern(1 1) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) 
> /* 
>         */  nomtitle  nonumber replace                  
(output written to tables and figures\table_c9.tex)

. 
.         
. * Table C10.                    
. * Release election      
.                 eststo reg_broad_basic: quietly areg camp_exp_pc month0_3 month3_12 month12_n i.term , absorb(codigo_uf) robust cluster($cluster)

.                                 sum camp_exp_pc if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "2.870"

.                                 estadd local state_fe "\checkmark": reg_broad_basic

. 
.                 eststo reg_broad_basic_c: quietly areg camp_exp_pc month0_3 month3_12 month12_n $muni_controls $mayor_controls i.term , absorb(codigo_
> uf) robust cluster($cluster)

.                                 sum camp_exp_pc if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "2.870"

.                                 estadd local state_fe "\checkmark": reg_broad_basic_c

.                                 estadd local mayor_municipal "\checkmark": reg_broad_basic_c

. 
.                 eststo reg_median: quietly areg camp_exp_pc month0_3 month3_12 month12_n above_median_corrupt median_month0_3 median_month3_12 median_
> year12_n i.term, absorb(codigo_uf) robust  cluster($cluster)

.                                 sum camp_exp_pc if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "2.854"

.                                 estadd local state_fe "\checkmark": reg_median

.                                 
.                                 lincom month0_3 + median_month0_3

 ( 1)  month0_3 + median_month0_3 = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .1565502   .5435838     0.29   0.773    -.9105103    1.223611
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2_0 `estimate': reg_median

.                                 estadd local p_value `p_test': reg_median

. 
.                                 lincom month3_12 + median_month3_12

 ( 1)  month3_12 + median_month3_12 = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .7849542   .4760028     1.65   0.100     -.149444    1.719352
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2_3 `estimate': reg_median

.                                 estadd local p_value3 `p_test': reg_median

. 
.                                 lincom month12_n + median_year12_n

 ( 1)  month12_n + median_year12_n = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .3599879   .4363854     0.82   0.410     -.496641    1.216617
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2_12 `estimate': reg_median

.                                 estadd local p_value12 `p_test': reg_median

. 
.                 eststo reg_median_c: quietly areg camp_exp_pc month0_3 month3_12 month12_n above_median_corrupt median_month0_3 median_month3_12 media
> n_year12_n $muni_controls $mayor_controls i.term, absorb(codigo_uf) robust  cluster($cluster)

.                                 sum camp_exp_pc if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "2.854"

.                                 estadd local state_fe "\checkmark": reg_median_c

.                                 estadd local mayor_municipal "\checkmark": reg_median_c

.                                 
.                                 lincom month0_3 + median_month0_3

 ( 1)  month0_3 + median_month0_3 = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .0631448   .5507087     0.11   0.909    -1.017902    1.144191
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2_0 `estimate': reg_median_c

.                                 estadd local p_value `p_test': reg_median_c

. 
.                                 lincom month3_12 + median_month3_12

 ( 1)  month3_12 + median_month3_12 = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .8042784   .4788794     1.68   0.093    -.1357667    1.744323
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2_3 `estimate': reg_median_c

.                                 estadd local p_value3 `p_test': reg_median_c

. 
.                                 lincom month12_n + median_year12_n

 ( 1)  month12_n + median_year12_n = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .3351319   .4430996     0.76   0.450    -.5346771    1.204941
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2_12 `estimate': reg_median_c

.                                 estadd local p_value12 `p_test': reg_median_c

. 
. 
. 
.                 #delimit;
delimiter now ;
.                         esttab reg_broad_basic reg_broad_basic_c reg_median reg_median_c
>                         using "tables and figures\table_c10.tex", b(3) se compress label star(* 0.10 ** 0.05 *** 0.01) replace
>                         mgroups( "\shortstack{Information \\ disclosure}""\shortstack{Median \\ Corruption}"     , pattern(1 0 1 0  ) prefix(\multicol
> umn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) 
>                         keep(month0_3 month3_12 month12_n above_median_corrupt median_month0_3 median_month3_12 median_year12_n ) 
>                         stats(N mD mayor_municipal state_fe r2_a b0_b2_0 p_value b0_b2_3 p_value3 b0_b2_12 p_value12, fmt(%9.0fc %9.3fc ) labels("Obse
> rvations" "Dep. Var. Mean" "Mayor and municipal controls" "State and term FE" "Adjusted R$^2$" "$\beta_0+\beta_2 \, c_{ist}$ ($<$ 3 months)" "p-value"
>   "$\beta_0+\beta_2 \, c_{ist}$ (3 to 12 months)" "p-value"  "$\beta_0+\beta_2 \, c_{ist}$ ($>$ 12 months)" "p-value" ))
>                         /*nonum*/ ar2 booktabs nonotes nomtitles title(deletethis) 
>                         substitute(\begin{table}[htbp]\centering \centering \caption{deletethis} /*\footnotesize*/{ \end{tabular} \end{tabular}} \end{
> table} %);
(output written to tables and figures\table_c10.tex)

.                 #delimit cr
delimiter now cr
. 
.                                         
. * Table c11 in "analysis_polls.do"
. * Table c12 in "analysis_polls.do"
. 
. 
. * Table c.13
. * Regressions Bolsa Familia
.         global BEFORE before

.         global corrupt broad    

.         local Other_reg "bolsa_pc valor"

.         foreach dep_var of varlist `Other_reg' {
  2.           
.                         eststo m_c_`dep_var': quietly areg `dep_var' $BEFORE above_median_corrupt median_before $muni_controls $mayor_controls i.term 
> if rerun == 1, absorb(codigo_uf) robust  cluster(id_city)
  3.                                 sum `dep_var' if e(sample), mean 
  4.                                 loc mymean: display %9.3f r(mean)       
  5.                                 estadd local mD `mymean', replace       
  6.                                 estadd local state_fe "\checkmark": m_c_`dep_var'
  7.                                 estadd local mayor_municipal "\checkmark": m_c_`dep_var'
  8.                                 * Add Test interactions
.                                 lincom $BEFORE + median_before
  9.                                 local estimate: display %9.3f r(estimate)
 10.                                 local p_test: display %9.3f r(p)
 11.                                 estadd local b0_b2 `estimate': m_c_`dep_var'
 12.                                 estadd local p_value `p_test': m_c_`dep_var'
 13. 
.                         eststo q_c_`dep_var': quietly areg `dep_var' $BEFORE quartile2 quartile3 quartile4 quart2_before quart3_before quart4_before $
> muni_controls $mayor_controls i.term if rerun == 1, absorb(codigo_uf) robust  cluster(id_city)
 14.                                 sum `dep_var' if e(sample), mean 
 15.                                 loc mymean: display %9.3f r(mean)       
 16.                                 estadd local mD `mymean', replace       
 17.                                 estadd local state_fe "\checkmark": q_c_`dep_var'
 18.                                 estadd local mayor_municipal "\checkmark": q_c_`dep_var'
 19.                                 * Add Test interactions
.                                 lincom $BEFORE + quart4_before
 20.                                 local estimate: display %9.3f r(estimate)
 21.                                 local p_test: display %9.3f r(p)
 22.                                 estadd local b0_b2 `estimate': q_c_`dep_var'
 23.                                 estadd local p_value `p_test': q_c_`dep_var'                                                            
 24.         }

added macro:
                 e(mD) : "6.911"

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
    bolsa_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .1016743   .2094204     0.49   0.627    -.3093738    .5127223
------------------------------------------------------------------------------

added macro:
                 e(mD) : "6.911"

 ( 1)  before + quart4_before = 0

------------------------------------------------------------------------------
    bolsa_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .4657947   .2833774     1.64   0.101    -.0904152    1.022005
------------------------------------------------------------------------------

added macro:
                 e(mD) : "30.791"

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
       valor | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .1796392   .2787655     0.64   0.519    -.3675186    .7267971
------------------------------------------------------------------------------

added macro:
                 e(mD) : "30.791"

 ( 1)  before + quart4_before = 0

------------------------------------------------------------------------------
       valor | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |  -.1527737   .4056058    -0.38   0.707    -.9488922    .6433447
------------------------------------------------------------------------------

.         
. * Regressions Public Employment
. preserve

. capture gen Before_1 = before_1

.         replace Before_1 = 1 if Before_1 == 0 &  lottery == 25 & term ==2005 
(40 real changes made)

.         label var Before_1 "Lottery occurred before the year previous of the election."

. 
.         replace before = Before_1
(61 real changes made)

.         global BEFORE before

.         global corrupt broad

.         local Other_reg "empl_perm_pc empl_trans_pc"

.                 
.         foreach dep_var of varlist `Other_reg' {
  2.             
.                         eststo m_c_`dep_var': quietly areg `dep_var' $BEFORE above_median_corrupt median_before $muni_controls $mayor_controls i.term 
> if rerun == 1, absorb(codigo_uf) robust  cluster(id_city)
  3.                                 sum `dep_var' if e(sample), mean 
  4.                                 loc mymean: display %9.3f r(mean)       
  5.                                 estadd local mD `mymean', replace       
  6.                                 estadd local state_fe "\checkmark": m_c_`dep_var'
  7.                                 estadd local mayor_municipal "\checkmark": m_c_`dep_var'
  8.                                 * Add Test interactions
.                                 lincom $BEFORE + median_before
  9.                                 local estimate: display %9.3f r(estimate)
 10.                                 local p_test: display %9.3f r(p)
 11.                                 estadd local b0_b2 `estimate': m_c_`dep_var'
 12.                                 estadd local p_value `p_test': m_c_`dep_var'
 13.         
.                         eststo q_c_`dep_var': quietly areg `dep_var' $BEFORE quartile2 quartile3 quartile4 quart2_before quart3_before quart4_before $
> muni_controls $mayor_controls i.term if rerun == 1, absorb(codigo_uf) robust  cluster(id_city)
 14.                                 sum `dep_var' if e(sample), mean 
 15.                                 loc mymean: display %9.3f r(mean)       
 16.                                 estadd local mD `mymean', replace       
 17.                                 estadd local state_fe "\checkmark": q_c_`dep_var'
 18.                                 estadd local mayor_municipal "\checkmark": q_c_`dep_var'
 19.                                 * Add Test interactions
.                                 lincom $BEFORE + quart4_before
 20.                                 local estimate: display %9.3f r(estimate)
 21.                                 local p_test: display %9.3f r(p)
 22.                                 estadd local b0_b2 `estimate': q_c_`dep_var'
 23.                                 estadd local p_value `p_test': q_c_`dep_var'                                                            
 24.         }

added macro:
                 e(mD) : "3.076"

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
empl_perm_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .0539778   .1419134     0.38   0.704    -.2245667    .3325223
------------------------------------------------------------------------------

added macro:
                 e(mD) : "3.076"

 ( 1)  before + quart4_before = 0

------------------------------------------------------------------------------
empl_perm_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   -.087051   .2028675    -0.43   0.668     -.485235    .3111329
------------------------------------------------------------------------------

added macro:
                 e(mD) : "1.028"

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
empl_trans~c | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |  -.0451844   .1287752    -0.35   0.726    -.2979417    .2075729
------------------------------------------------------------------------------

added macro:
                 e(mD) : "1.028"

 ( 1)  before + quart4_before = 0

------------------------------------------------------------------------------
empl_trans~c | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .0762143   .1907663     0.40   0.690    -.2982178    .4506464
------------------------------------------------------------------------------

.         
. restore

.         
.   eststo dir

--------------------------------------------------------------------------------------
             |           Dependent  Number of        
        Name | Command    variable     param.  Title 
-------------+------------------------------------------------------------------------
        est1 | estpost   no depvar          0  2001
        est2 | estpost   no depvar          0  2005
reg_broad_~c | areg      camp_exp_pc        6  Linear regression, absorbing indicators
reg_broad_~c | areg      camp_exp_pc       18  Linear regression, absorbing indicators
  reg_median | areg      camp_exp_pc       10  Linear regression, absorbing indicators
reg_median_c | areg      camp_exp_pc       22  Linear regression, absorbing indicators
m_c_bolsa_pc | areg       bolsa_pc         18  Linear regression, absorbing indicators
q_c_bolsa_pc | areg       bolsa_pc         22  Linear regression, absorbing indicators
   m_c_valor | areg          valor         18  Linear regression, absorbing indicators
   q_c_valor | areg          valor         22  Linear regression, absorbing indicators
m_c_empl_p~c | areg      empl_perm_pc      18  Linear regression, absorbing indicators
q_c_empl_p~c | areg      empl_perm_pc      22  Linear regression, absorbing indicators
m_c_empl_t~c | areg      empl_trans~c      18  Linear regression, absorbing indicators
q_c_empl_t~c | areg      empl_trans~c      22  Linear regression, absorbing indicators
--------------------------------------------------------------------------------------

.           
.                 #delimit;
delimiter now ;
.                 esttab 
>                         m_c_bolsa_pc q_c_bolsa_pc m_c_valor q_c_valor 
>                         m_c_empl_perm_pc q_c_empl_perm_pc m_c_empl_trans_pc q_c_empl_trans_pc
>                         using "tables and figures\table_c13.tex", b(3) se compress label star(* 0.10 ** 0.05 *** 0.01) replace
>                         mtitles( "Median" "Quartile"  "Median" "Quartile" "Median" "Quartile" "Median" "Quartile") 
>                         mgroups( "\shortstack{Beneficiary families \\(\% population)}"   "Value of benefits" "Permanent employees" "Transitory employe
> es"  , pattern(1 0 1 0 1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) 
>                         keep($BEFORE above_median_corrupt median_before 
>                                  quart2_before quart3_before quart4_before quartile2 quartile3 quartile4)
>                         stats(N mD r2_a b0_b2 p_value, fmt(%9.0fc %9.3fc ) labels("Observations" "Dep. Var. Mean" "Adjusted R$^2$" "$\beta_0+\beta_2 \
> , c_{ist}$" "p-value"))
>                         /*nonum*/ ar2 booktabs nonotes /*nomtitles*/ title(deletethis) 
>                         substitute(\begin{table}[htbp]\centering \centering \caption{deletethis} /*\footnotesize*/{ \end{tabular} \end{tabular}} \end{
> table} %);
(output written to tables and figures\table_c13.tex)

.                 #delimit cr
delimiter now cr
. 
. 
. * table c14     in "analysis_extras.do"
. * table c15 in "analysis_extras.do"
. * Table c16     in "analysis_extras.do"
. * Table c17 in "analysis_extras.do"
. 
. 
. * Figure c1
. histogram camp_exp_pc, freq 
(bin=29, start=.00051111, width=1.8057817)

.         graph export "tables and figures\figure_c1a.pdf", replace 
file tables and figures\figure_c1a.pdf saved as PDF format

. 
. preserve

. use "data_brasil_camp_chall.dta", clear

. histogram camp_exp_pc, freq 
(bin=28, start=.00199146, width=1.5725618)

.         graph export "tables and figures\figure_c1b.pdf", replace
file tables and figures\figure_c1b.pdf saved as PDF format

. restore

. 
. * Figure c2 in "analysis_polls.do"
. 
. eststo clear            

. 
end of do-file
C:\Users\75618rpo\Dropbox\Research\Literature Latex\Corruption, accountability and voting\Submission R&R JoP\Replication\replication_package_JOP

. * Analysis with municipal polls
. use data_polls.dta, clear

.         
. global cluster id_city

. global size_column "{p{5.5cm}p{1cm}p{1cm}p{1cm}p{1cm}p{1.5cm}p{1.5cm}c}"

. global format_table "vce(cluster $cluster) wide(mean1 sd1 mean2 sd2 diff pval) pvalues varlabels  format(%9.2f) nostars nonumbers noobservations nolin
> es"

. 
.         global candidates_vars share_male share_married av_age av_education

.                 label var share_male "Male (\%)"

.                 label var share_married "Married (\%)"

.                 label var av_age "Average Age"

.                 label var av_education "Average Education"

.                 
.         global electoral_vars number_candidates electorate_eff turnout

.                 label var number_candidates "Number of Candidates"

.                 label var electorate_eff "Electorate (1,000 people)"

.                 label var turnout "Turnout"     

. 
.         global muni_controls lpib_pc gini illiteracy share_urb radio_am 

.                 label var lpib_pc "GDP per capita (in ln)"

.                 label var radio_am "AM Radio Station"

.                 label var gini "Gini index"

.                 label var illiteracy "Illiteracy rate"

.                 label var share_urb     "Share urban population"                

.         
. * table c.11
. preserve

. bysort poll_muni: sum electorate_eff ,d 

--------------------------------------------------------------------------------------------------------------------------------------------------------
-> poll_muni = 0

                  Electorate (1,000 people)
-------------------------------------------------------------
      Percentiles      Smallest
 1%        1.072           .599
 5%        1.827           .768
10%        2.234           .853       Obs                 883
25%        3.419           .909       Sum of wgt.         883

50%        6.296                      Mean           13.12821
                        Largest       Std. dev.      22.99039
75%       12.904        174.939
90%       26.433        188.645       Variance       528.5579
95%       45.618         231.09       Skewness       5.186139
99%      133.319        237.571       Kurtosis        37.2312

--------------------------------------------------------------------------------------------------------------------------------------------------------
-> poll_muni = 1

                  Electorate (1,000 people)
-------------------------------------------------------------
      Percentiles      Smallest
 1%       31.659         31.659
 5%       45.014         33.851
10%       50.533         36.076       Obs                  98
25%       80.021         44.123       Sum of wgt.          98

50%      147.354                      Mean           249.5207
                        Largest       Std. dev.      381.6167
75%      276.119        939.712
90%      541.393       1113.128       Variance       145631.3
95%      808.422       1205.372       Skewness       5.411761
99%     3242.708       3242.708       Kurtosis       40.38088


. capture drop comparable

. gen comparable = 0

.         replace comparable = 1 if electorate_eff<= 250
(956 real changes made)

.         replace radio_am = 100 if radio_am == 1 
(300 real changes made)

. 
. tab comparable poll_muni                

           |       poll_muni
comparable |         0          1 |     Total
-----------+----------------------+----------
         0 |         0         25 |        25 
         1 |       883         73 |       956 
-----------+----------------------+----------
     Total |       883         98 |       981 

. bysort poll_muni: sum electorate_eff if comparable == 1,d       

--------------------------------------------------------------------------------------------------------------------------------------------------------
-> poll_muni = 0

                  Electorate (1,000 people)
-------------------------------------------------------------
      Percentiles      Smallest
 1%        1.072           .599
 5%        1.827           .768
10%        2.234           .853       Obs                 883
25%        3.419           .909       Sum of wgt.         883

50%        6.296                      Mean           13.12821
                        Largest       Std. dev.      22.99039
75%       12.904        174.939
90%       26.433        188.645       Variance       528.5579
95%       45.618         231.09       Skewness       5.186139
99%      133.319        237.571       Kurtosis        37.2312

--------------------------------------------------------------------------------------------------------------------------------------------------------
-> poll_muni = 1

                  Electorate (1,000 people)
-------------------------------------------------------------
      Percentiles      Smallest
 1%       31.659         31.659
 5%       44.123         33.851
10%       46.617         36.076       Obs                  73
25%        64.14         44.123       Sum of wgt.          73

50%      101.464                      Mean           114.9659
                        Largest       Std. dev.      56.77384
75%      164.273        220.747
90%      187.559        227.709       Variance       3223.268
95%      220.747        242.249       Skewness       .4139602
99%      243.236        243.236       Kurtosis       2.111582


. 
. balancetable poll_muni $candidates_vars using "tables and figures\table_c11a.tex" if comparable == 1, $format_table replace prehead("\begin{tabularx}{
> \linewidth}  $size_column {\textit{A. Candidates' characteristics}} \\") postfoot("\end{tabularx}") 

.         
. balancetable poll_muni $electoral_vars using "tables and figures\table_c11b.tex" if comparable == 1, $format_table replace prehead("\begin{tabularx}{\
> linewidth}  $size_column {\textit{B. Electoral characteristics}} \\") postfoot("\end{tabularx}") 

. 
. balancetable poll_muni $muni_controls using "tables and figures\table_c11c.tex" if comparable == 1, $format_table replace prehead("\begin{tabularx}{\l
> inewidth} $size_column {\textit{C. Municipal characteristics}} \\") postfoot("\end{tabularx}")    

.         
. * table c.12
. gen comparable2 = 1

.         replace comparable2 = 0 if poll_muni == 1 & comparable == 0
(25 real changes made)

.         replace comparable2 = 0 if poll_muni == 0 & electorate_eff <= 30
(806 real changes made)

.         tab comparable2 poll_muni

comparable |       poll_muni
         2 |         0          1 |     Total
-----------+----------------------+----------
         0 |       806         25 |       831 
         1 |        77         73 |       150 
-----------+----------------------+----------
     Total |       883         98 |       981 

.         replace radio_am = 100 if radio_am == 1 
(0 real changes made)

.         
. balancetable poll_muni $candidates_vars using "tables and figures\table_c12a.tex" if comparable2 == 1, $format_table replace prehead("\begin{tabularx}
> {\linewidth}  $size_column {\textit{A. Candidates' characteristics}} \\") postfoot("\end{tabularx}") 

.         
. balancetable poll_muni $electoral_vars using "tables and figures\table_c12b.tex" if comparable2 == 1, $format_table replace prehead("\begin{tabularx}{
> \linewidth}  $size_column {\textit{B. Electoral characteristics}} \\") postfoot("\end{tabularx}") 

. 
. balancetable poll_muni $muni_controls using "tables and figures\table_c12c.tex" if comparable2 == 1, $format_table replace prehead("\begin{tabularx}{\
> linewidth} $size_column {\textit{C. Municipal characteristics}} \\") postfoot("\end{tabularx}")   

. restore

.         
. * Figure C.2 
. keep if poll_muni== 1
(883 observations deleted)

. 
. gen share_vote_margin100 = share_vote_margin *100

. twoway (scatter  poll_begin_mar share_vote_margin100) (lfit  poll_begin_mar share_vote_margin100), graphregion(color(white)) legend( off) xtitle("Prev
> ious win margin") ytitle("Expected win margin")

. graph export "tables and figures\figure_c2.pdf", replace
file tables and figures\figure_c2.pdf saved as PDF format

. 
. eststo clear    

. 
end of do-file
C:\Users\75618rpo\Dropbox\Research\Literature Latex\Corruption, accountability and voting\Submission R&R JoP\Replication\replication_package_JOP

. * Extra results from appendix C. 
. use data_others.dta, clear

. 
. global true_mayor_controls mayor_male mayor_married mayor_age mayor_education mayor_prev_mayor mayor_share_vote_margin mayor_dum_PT

. global muni_controls lpib_pc gini illiteracy share_urb radio_am 

.         label var lpib_pc "GDP per capita (in ln)"

.         label var radio_am "AM Radio Station"

.         label var gini "Gini index"

.         label var illiteracy "Illiteracy rate"

.         label var share_urb     "Share urban population"

.                 
. global candidate_controls male married age education prev_mayor dum_PT

.         label var prev_mayor "Previous mayor"

.         label var dum_PT "Workers' Party dummy"

.                  
.  
. *table c.14
. 
. * Bolsa Familia
.         global BEFORE before

.         global corrupt broad

.         
.         local Other_reg "bolsa_pc valor"

.                 
.         foreach dep_var of varlist `Other_reg' {
  2.             
.         * Median  + controls    
.                         eststo m_c_`dep_var': quietly areg `dep_var' $BEFORE above_median_corrupt median_before $muni_controls $true_mayor_controls i.
> term if eligible == 0, absorb(codigo_uf) robust  cluster(id_city)
  3.                                 sum `dep_var' if e(sample), mean 
  4.                                 loc mymean: display %9.3f r(mean)       
  5.                                 estadd local mD `mymean', replace       
  6.                                 estadd local state_fe "\checkmark": m_c_`dep_var'
  7.                                 estadd local mayor_municipal "\checkmark": m_c_`dep_var'
  8.                                 * Add Test interactions
.                                 lincom $BEFORE + median_before
  9.                                 local estimate: display %9.3f r(estimate)
 10.                                 local p_test: display %9.3f r(p)
 11.                                 estadd local b0_b2 `estimate': m_c_`dep_var'
 12.                                 estadd local p_value `p_test': m_c_`dep_var'
 13. 
. 
.         *Quartile  + controls
.                         eststo q_c_`dep_var': quietly areg `dep_var' $BEFORE quartile2 quartile3 quartile4 quart2_before quart3_before quart4_before $
> muni_controls $true_mayor_controls i.term if eligible == 0, absorb(codigo_uf) robust  cluster(id_city)
 14.                                 sum `dep_var' if e(sample), mean 
 15.                                 loc mymean: display %9.3f r(mean)       
 16.                                 estadd local mD `mymean', replace       
 17.                                 estadd local state_fe "\checkmark": q_c_`dep_var'
 18.                                 estadd local mayor_municipal "\checkmark": q_c_`dep_var'
 19.                                 * Add Test interactions
.                                 lincom $BEFORE + quart4_before
 20.                                 local estimate: display %9.3f r(estimate)
 21.                                 local p_test: display %9.3f r(p)
 22.                                 estadd local b0_b2 `estimate': q_c_`dep_var'
 23.                                 estadd local p_value `p_test': q_c_`dep_var'                                                            
 24.         }

added macro:
                 e(mD) : "6.410"

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
    bolsa_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |  -.0619324   .2443852    -0.25   0.800    -.5418234    .4179585
------------------------------------------------------------------------------

added macro:
                 e(mD) : "6.410"

 ( 1)  before + quart4_before = 0

------------------------------------------------------------------------------
    bolsa_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |  -.1239197   .3201991    -0.39   0.699    -.7526838    .5048443
------------------------------------------------------------------------------

added macro:
                 e(mD) : "31.478"

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
       valor | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .6372283   .3135065     2.03   0.043     .0216064     1.25285
------------------------------------------------------------------------------

added macro:
                 e(mD) : "31.478"

 ( 1)  before + quart4_before = 0

------------------------------------------------------------------------------
       valor | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .9404899   .4066238     2.31   0.021     .1420166    1.738963
------------------------------------------------------------------------------

.         
.                 
. * Regressions Public Employment
. preserve

. capture gen Before_1 = before_1

.         replace Before_1 = 1 if Before_1 == 0 &  lottery == 25 & term ==2005
(28 real changes made)

.         label var Before_1 "Lottery occurred before the year previous of the election."

. 
.         replace before = Before_1
(59 real changes made)

.         
.         global BEFORE before

.         global corrupt broad

.         
.         local Other_reg "empl_perm_pc empl_trans_pc"

.                 
.         foreach dep_var of varlist `Other_reg' {
  2.             
.         * Median  + controls
.             
.                         eststo m_c_`dep_var': quietly areg `dep_var' $BEFORE above_median_corrupt median_before $muni_controls $true_mayor_controls i.
> term if eligible == 0, absorb(codigo_uf) robust  cluster(id_city)
  3.                                 sum `dep_var' if e(sample), mean 
  4.                                 loc mymean: display %9.3f r(mean)       
  5.                                 estadd local mD `mymean', replace       
  6.                                 estadd local state_fe "\checkmark": m_c_`dep_var'
  7.                                 estadd local mayor_municipal "\checkmark": m_c_`dep_var'
  8.                                 * Add Test interactions
.                                 lincom $BEFORE + median_before
  9.                                 local estimate: display %9.3f r(estimate)
 10.                                 local p_test: display %9.3f r(p)
 11.                                 estadd local b0_b2 `estimate': m_c_`dep_var'
 12.                                 estadd local p_value `p_test': m_c_`dep_var'
 13. 
. 
.         *Quartile  + controls
.         
.                         eststo q_c_`dep_var': quietly areg `dep_var' $BEFORE quartile2 quartile3 quartile4 quart2_before quart3_before quart4_before $
> muni_controls $true_mayor_controls i.term if eligible == 0, absorb(codigo_uf) robust  cluster(id_city)
 14.                                 sum `dep_var' if e(sample), mean 
 15.                                 loc mymean: display %9.3f r(mean)       
 16.                                 estadd local mD `mymean', replace       
 17.                                 estadd local state_fe "\checkmark": q_c_`dep_var'
 18.                                 estadd local mayor_municipal "\checkmark": q_c_`dep_var'
 19.                                 * Add Test interactions
.                                 lincom $BEFORE + quart4_before
 20.                                 local estimate: display %9.3f r(estimate)
 21.                                 local p_test: display %9.3f r(p)
 22.                                 estadd local b0_b2 `estimate': q_c_`dep_var'
 23.                                 estadd local p_value `p_test': q_c_`dep_var'                                                            
 24.         }

added macro:
                 e(mD) : "3.148"

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
empl_perm_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   -.114055   .1550047    -0.74   0.462    -.4184315    .1903215
------------------------------------------------------------------------------

added macro:
                 e(mD) : "3.148"

 ( 1)  before + quart4_before = 0

------------------------------------------------------------------------------
empl_perm_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .1242695   .1982713     0.63   0.531    -.2650679    .5136069
------------------------------------------------------------------------------

added macro:
                 e(mD) : "0.838"

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
empl_trans~c | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |  -.0697536   .1056077    -0.66   0.509    -.2771312     .137624
------------------------------------------------------------------------------

added macro:
                 e(mD) : "0.838"

 ( 1)  before + quart4_before = 0

------------------------------------------------------------------------------
empl_trans~c | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |  -.1698459   .1408625    -1.21   0.228     -.446452    .1067602
------------------------------------------------------------------------------

.         
. restore

.         
.   eststo dir

--------------------------------------------------------------------------------------
             |           Dependent  Number of        
        Name | Command    variable     param.  Title 
-------------+------------------------------------------------------------------------
m_c_bolsa_pc | areg       bolsa_pc         18  Linear regression, absorbing indicators
q_c_bolsa_pc | areg       bolsa_pc         22  Linear regression, absorbing indicators
   m_c_valor | areg          valor         18  Linear regression, absorbing indicators
   q_c_valor | areg          valor         22  Linear regression, absorbing indicators
m_c_empl_p~c | areg      empl_perm_pc      18  Linear regression, absorbing indicators
q_c_empl_p~c | areg      empl_perm_pc      22  Linear regression, absorbing indicators
m_c_empl_t~c | areg      empl_trans~c      18  Linear regression, absorbing indicators
q_c_empl_t~c | areg      empl_trans~c      22  Linear regression, absorbing indicators
--------------------------------------------------------------------------------------

.           
.                 #delimit;
delimiter now ;
.                 esttab 
>                         m_c_bolsa_pc q_c_bolsa_pc m_c_valor q_c_valor 
>                         m_c_empl_perm_pc q_c_empl_perm_pc m_c_empl_trans_pc q_c_empl_trans_pc
>                         using "tables and figures\table_c14.tex", b(3) se compress label star(* 0.10 ** 0.05 *** 0.01) replace
>                         mtitles( "Median" "Quartile"  "Median" "Quartile" "Median" "Quartile" "Median" "Quartile") 
>                         mgroups( "\shortstack{Beneficiary families \\(\% population)}"   "Value of benefits" "Permanent employees" "Transitory employe
> es"  , pattern(1 0 1 0 1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) 
>                         keep($BEFORE above_median_corrupt median_before 
>                                  quart2_before quart3_before quart4_before quartile2 quartile3 quartile4)
>                         stats(N mD r2_a b0_b2 p_value, fmt(%9.0fc %9.3fc ) labels("Observations" "Dep. Var. Mean" "Adjusted R$^2$" "$\beta_0+\beta_2 \
> , c_{ist}$" "p-value"))
>                         /*nonum*/ ar2 booktabs nonotes /*nomtitles*/ title(deletethis) 
>                         substitute(\begin{table}[htbp]\centering \centering \caption{deletethis} /*\footnotesize*/{ \end{tabular} \end{tabular}} \end{
> table} %);
(output written to tables and figures\table_c14.tex)

.                         #delimit cr
delimiter now cr
. 
. 
. 
.         
. * Table c.15 
. * Effect of reputation shocks On coalition members' campaign expenditure (per capita)
. eststo clear    

. 
.         * 0. Baseline: Average causal Impact of Information Disclosure.
.                 eststo reg_broad_basic: quietly areg camp_exp_pc before i.term , absorb(codigo_uf) robust cluster($cluster)

.                                 sum camp_exp_pc if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "2.651"

.                                 estadd local state_fe "\checkmark": reg_broad_basic

. 
.                 * 0.1. baseline + controls
.                 eststo reg_broad_basic_c: quietly areg camp_exp_pc before $muni_controls $candidate_controls i.term , absorb(codigo_uf) robust cluster
> ($cluster)

.                                 sum camp_exp_pc if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "2.649"

.                                 estadd local state_fe "\checkmark": reg_broad_basic_c

.                                 estadd local mayor_municipal "\checkmark": reg_broad_basic_c

.         
.         * 1. Broad                              
.                 eststo reg_broad: quietly areg camp_exp_pc before broad before_broad i.term , absorb(codigo_uf) robust cluster($cluster)

.                                 * Add mean dependent variable
.                                 sum camp_exp_pc if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "2.651"

.                                 estadd local state_fe "\checkmark": reg_broad

.                                 lincom before + before_broad

 ( 1)  before + before_broad = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .0645992   .2987328     0.22   0.829    -.5218282    .6510267
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': reg_broad

.                                 estadd local p_value `p_test': reg_broad

. 
.                 *1.2. broad + controls                  
.                 eststo reg_broad_c: quietly areg camp_exp_pc before broad before_broad  $muni_controls $candidate_controls i.term , absorb(codigo_uf) 
> robust cluster($cluster)

.                                 sum camp_exp_pc if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "2.649"

.                                 estadd local state_fe "\checkmark": reg_broad_c

.                                 estadd local mayor_municipal "\checkmark": reg_broad_c

.                                 lincom before + before_broad

 ( 1)  before + before_broad = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .0578796    .304297     0.19   0.849    -.5394742    .6552334
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': reg_broad_c

.                                 estadd local p_value `p_test': reg_broad_c                              

. 
.         * 2. fraction_broad             
.                 eststo reg_fraction: quietly areg camp_exp_pc before fraction_broad corrupt_before i.term, absorb(codigo_uf) robust  cluster($cluster)

.                                 sum camp_exp_pc if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "2.643"

.                                 estadd local state_fe "\checkmark": reg_fraction

.                                 sum fraction_broad if e(sample), mean 

.                                 loc my_mean: display %9.3f r(mean)                              

.                                 lincom before + corrupt_before * `my_mean'      

 ( 1)  before + 5.029*corrupt_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .1577308   .2848267     0.55   0.580    -.4014452    .7169067
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': reg_fraction

.                                 estadd local p_value `p_test': reg_fraction             

.                                 
.                 *2.2 fraction_broad + controls                  
.                 eststo reg_fraction_c: quietly areg camp_exp_pc before fraction_broad corrupt_before $muni_controls $candidate_controls  i.term, absor
> b(codigo_uf) robust  cluster($cluster)

.                                 sum camp_exp_pc if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "2.640"

.                                 estadd local state_fe "\checkmark": reg_fraction_c

.                                 estadd local mayor_municipal "\checkmark": reg_fraction_c

.                                 sum fraction_broad if e(sample), mean 

.                                 loc my_mean: display %9.3f r(mean)                              

.                                 lincom before + corrupt_before * `my_mean'      

 ( 1)  before + 5.014*corrupt_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .1315229    .290636     0.45   0.651    -.4390619    .7021076
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': reg_fraction_c

.                                 estadd local p_value `p_test': reg_fraction_c

.                                                                 
.         * 3. above_median_broad                                                         
.                 eststo reg_median: quietly areg camp_exp_pc before above_median_corrupt median_before i.term, absorb(codigo_uf) robust  cluster($clust
> er)

.                                 sum camp_exp_pc if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "2.643"

.                                 estadd local state_fe "\checkmark": reg_median

.                                 lincom before + median_before

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |  -.0165048   .3540523    -0.05   0.963    -.7115855    .6785758
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': reg_median

.                                 estadd local p_value `p_test': reg_median

. 
.                 *3.2. above_median_broad + controls
.                 eststo reg_median_c: quietly areg camp_exp_pc before above_median_corrupt median_before $muni_controls $candidate_controls i.term, abs
> orb(codigo_uf) robust  cluster($cluster)

.                                 sum camp_exp_pc if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "2.640"

.                                 estadd local state_fe "\checkmark": reg_median_c

.                                 estadd local mayor_municipal "\checkmark": reg_median_c

.                                 lincom before + median_before

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |  -.0211962   .3696262    -0.06   0.954    -.7468567    .7044643
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': reg_median_c

.                                 estadd local p_value `p_test': reg_median_c

. 
.         * 4. quartiles broad
.                 eststo reg_quart:   quietly areg camp_exp_pc before quartile2 quartile3 quartile4 quart2_before quart3_before quart4_before i.term, ab
> sorb(codigo_uf) robust cluster($cluster)

.                                 sum camp_exp_pc if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "2.643"

.                                 estadd local state_fe "\checkmark": reg_quart

.                                 lincom before + quart4_before

 ( 1)  before + quart4_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |  -.2780135   .5654951    -0.49   0.623    -1.388202    .8321748
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': reg_quart

.                                 estadd local p_value `p_test': reg_quart

. 
.                 *4.2 quartiles broad + controls
.                 eststo reg_quart_c: quietly areg camp_exp_pc before quartile2 quartile3 quartile4 quart2_before quart3_before quart4_before $muni_cont
> rols $candidate_controls   i.term, absorb(codigo_uf) robust  cluster($cluster)

.                                 sum camp_exp_pc if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "2.640"

.                                 estadd local state_fe "\checkmark": reg_quart_c

.                                 estadd local mayor_municipal "\checkmark": reg_quart_c

.                                 lincom before + quart4_before

 ( 1)  before + quart4_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |  -.3219512   .5814379    -0.55   0.580    -1.463446     .819544
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': reg_quart_c

.                                 estadd local p_value `p_test': reg_quart_c

.                                                 
. 
.                                                 
. * EXPORT TABLE TO LATEX         
.                 #delimit;
delimiter now ;
.                         esttab reg_broad_basic reg_broad_basic_c reg_broad reg_broad_c reg_fraction reg_fraction_c reg_median reg_median_c reg_quart r
> eg_quart_c
>                         using "tables and figures\table_c15.tex", b(3) se compress label star(* 0.10 ** 0.05 *** 0.01) replace
>                         mgroups( "\shortstack{Information \\ disclosure}" "Corruption"   "Share corruption"  "\shortstack{Median \\ Corruption}"   "\s
> hortstack{Quartiles\\ Corruption}"  , pattern(1 0 1 0 1 0 1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) 
>                         keep(before_broad before broad corrupt_before fraction_broad median_before above_median_corrupt quartile2 quartile3 quartile4 
> quart2_before quart3_before quart4_before ) 
>                         /*scalars("mayor_municipal Mayor and municipal controls" "state_fe State fixed effects")  */
>                         stats(N mD mayor_municipal state_fe r2_a b0_b2 p_value, fmt(%9.0fc %9.3fc ) labels("Observations" "Dep. Var. Mean" "Mayor and 
> municipal controls" "State and term FE" "Adjusted R$^2$" "$\beta_0+\beta_2 \, c_{ist}$" "p-value"))
>                         /*nonum*/ ar2 booktabs nonotes nomtitles title(deletethis) 
>                         substitute(\begin{table}[htbp]\centering \centering \caption{deletethis} /*\footnotesize*/{ \end{tabular} \end{tabular}} \end{
> table} %);
(output written to tables and figures\table_c15.tex)

.                         #delimit cr
delimiter now cr
.                                 
.                         
.         
.         
. * table c16      copartisan
.                 
. preserve

.         keep if merge_copartisan == 1           
(623 observations deleted)

.          sum camp_exp_pc if merge_copartisan == 1

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
 camp_exp_pc |        394    2.476662    2.906925   .0022503   30.11935

. 
. eststo clear    

. 
.         * 0. Baseline: Average causal Impact of Information Disclosure.
.                 eststo reg_broad_basic: quietly areg camp_exp_pc before i.term , absorb(codigo_uf) robust cluster($cluster)

.                                 sum camp_exp_pc if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "2.477"

.                                 estadd local state_fe "\checkmark": reg_broad_basic

. 
.                 * 0.1. baseline + controls
.                 eststo reg_broad_basic_c: quietly areg camp_exp_pc before $muni_controls $candidate_controls i.term , absorb(codigo_uf) robust cluster
> ($cluster)

.                                 sum camp_exp_pc if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "2.470"

.                                 estadd local state_fe "\checkmark": reg_broad_basic_c

.                                 estadd local mayor_municipal "\checkmark": reg_broad_basic_c

. 
.         * 1. Broad                              
.                 eststo reg_broad: quietly areg camp_exp_pc before broad before_broad i.term , absorb(codigo_uf) robust cluster($cluster)

.                                 * Add mean dependent variable
.                                 sum camp_exp_pc if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "2.477"

.                                 estadd local state_fe "\checkmark": reg_broad

.                                 lincom before + before_broad

 ( 1)  before + before_broad = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .2895173   .3304049     0.88   0.381     -.360128    .9391627
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': reg_broad

.                                 estadd local p_value `p_test': reg_broad

. 
.                 *1.2. broad + controls                  
.                 eststo reg_broad_c: quietly areg camp_exp_pc before broad before_broad  $muni_controls $candidate_controls i.term , absorb(codigo_uf) 
> robust cluster($cluster)

.                                 sum camp_exp_pc if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "2.470"

.                                 estadd local state_fe "\checkmark": reg_broad_c

.                                 estadd local mayor_municipal "\checkmark": reg_broad_c

.                                 lincom before + before_broad

 ( 1)  before + before_broad = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .2125633   .3576109     0.59   0.553    -.4905927    .9157192
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': reg_broad_c

.                                 estadd local p_value `p_test': reg_broad_c                              

. 
.         * 2. fraction_broad             
.                 eststo reg_fraction: quietly areg camp_exp_pc before fraction_broad corrupt_before i.term, absorb(codigo_uf) robust  cluster($cluster)

.                                 sum camp_exp_pc if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "2.471"

.                                 estadd local state_fe "\checkmark": reg_fraction

.                                 sum fraction_broad if e(sample), mean 

.                                 loc my_mean: display %9.3f r(mean)                              

.                                 lincom before + corrupt_before * `my_mean'      

 ( 1)  before + 5.295*corrupt_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .2934029    .373093     0.79   0.432    -.4402787    1.027085
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': reg_fraction

.                                 estadd local p_value `p_test': reg_fraction             

.                                 
.                 *2.2 fraction_broad + controls                  
.                 eststo reg_fraction_c: quietly areg camp_exp_pc before fraction_broad corrupt_before $muni_controls $candidate_controls  i.term, absor
> b(codigo_uf) robust  cluster($cluster)

.                                 sum camp_exp_pc if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "2.464"

.                                 estadd local state_fe "\checkmark": reg_fraction_c

.                                 estadd local mayor_municipal "\checkmark": reg_fraction_c

.                                 sum fraction_broad if e(sample), mean 

.                                 loc my_mean: display %9.3f r(mean)                              

.                                 lincom before + corrupt_before * `my_mean'      

 ( 1)  before + 5.267*corrupt_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .1925612   .4063404     0.47   0.636     -.606523    .9916454
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': reg_fraction_c

.                                 estadd local p_value `p_test': reg_fraction_c

.                                                                 
.         * 3. above_median_broad                                                         
.                 eststo reg_median: quietly areg camp_exp_pc before above_median_corrupt median_before i.term, absorb(codigo_uf) robust  cluster($clust
> er)

.                                 sum camp_exp_pc if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "2.471"

.                                 estadd local state_fe "\checkmark": reg_median

.                                 lincom before + median_before

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .3360501    .382048     0.88   0.380    -.4152414    1.087342
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': reg_median

.                                 estadd local p_value `p_test': reg_median

. 
.                 *3.2. above_median_broad + controls
.                 eststo reg_median_c: quietly areg camp_exp_pc before above_median_corrupt median_before $muni_controls $candidate_controls i.term, abs
> orb(codigo_uf) robust  cluster($cluster)

.                                 sum camp_exp_pc if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "2.464"

.                                 estadd local state_fe "\checkmark": reg_median_c

.                                 estadd local mayor_municipal "\checkmark": reg_median_c

.                                 lincom before + median_before

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .2131747   .4020183     0.53   0.596    -.5774099    1.003759
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': reg_median_c

.                                 estadd local p_value `p_test': reg_median_c

. 
.         * 4. quartiles broad
.                 eststo reg_quart:   quietly areg camp_exp_pc before quartile2 quartile3 quartile4 quart2_before quart3_before quart4_before i.term, ab
> sorb(codigo_uf) robust cluster($cluster)

.                                 sum camp_exp_pc if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "2.471"

.                                 estadd local state_fe "\checkmark": reg_quart

.                                 lincom before + quart4_before

 ( 1)  before + quart4_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .6076002   .5429355     1.12   0.264    -.4600741    1.675275
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': reg_quart

.                                 estadd local p_value `p_test': reg_quart

. 
.                 *4.2 quartiles broad + controls
.                 eststo reg_quart_c: quietly areg camp_exp_pc before quartile2 quartile3 quartile4 quart2_before quart3_before quart4_before $muni_cont
> rols $candidate_controls   i.term, absorb(codigo_uf) robust  cluster($cluster)

.                                 sum camp_exp_pc if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "2.464"

.                                 estadd local state_fe "\checkmark": reg_quart_c

.                                 estadd local mayor_municipal "\checkmark": reg_quart_c

.                                 lincom before + quart4_before

 ( 1)  before + quart4_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .4914751   .5773921     0.85   0.395    -.6439887    1.626939
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': reg_quart_c

.                                 estadd local p_value `p_test': reg_quart_c

.                                                 
.                                 
. * EXPORT TABLE TO LATEX         
.                 #delimit;
delimiter now ;
.                         esttab reg_broad_basic reg_broad_basic_c reg_broad reg_broad_c reg_fraction reg_fraction_c reg_median reg_median_c reg_quart r
> eg_quart_c
>                         using "tables and figures\table_c16.tex", b(3) se compress label star(* 0.10 ** 0.05 *** 0.01) replace
>                         mgroups( "\shortstack{Information \\ disclosure}" "Corruption"   "Share corruption"  "\shortstack{Median \\ Corruption}"   "\s
> hortstack{Quartiles\\ Corruption}"  , pattern(1 0 1 0 1 0 1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) 
>                         keep(before_broad before broad corrupt_before fraction_broad median_before above_median_corrupt quartile2 quartile3 quartile4 
> quart2_before quart3_before quart4_before ) 
>                         stats(N mD mayor_municipal state_fe r2_a b0_b2 p_value, fmt(%9.0fc %9.3fc ) labels("Observations" "Dep. Var. Mean" "Mayor and 
> municipal controls" "State and term FE" "Adjusted R$^2$" "$\beta_0+\beta_2 \, c_{ist}$" "p-value"))
>                         /*nonum*/ ar2 booktabs nonotes nomtitles title(deletethis) 
>                         substitute(\begin{table}[htbp]\centering \centering \caption{deletethis} /*\footnotesize*/{ \end{tabular} \end{tabular}} \end{
> table} %);
(output written to tables and figures\table_c16.tex)

.                         #delimit cr
delimiter now cr
.                                 
. restore

.         
.         
.         
. * tabla c.17
. 
. preserve

.         keep if party == "PT" | party == "PSDB"
(959 observations deleted)

.          sum camp_exp_pc 

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
 camp_exp_pc |        110    2.348766    2.459117   .0022503    14.7691

. 
. 
. eststo clear    

. 
.         * 0. Baseline: Average causal Impact of Information Disclosure.
.                 eststo reg_broad_basic: quietly areg camp_exp_pc before i.term , absorb(codigo_uf) robust cluster($cluster)

.                                 sum camp_exp_pc if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "2.349"

.                                 estadd local state_fe "\checkmark": reg_broad_basic

. 
.                 * 0.1. baseline + controls
.                 eststo reg_broad_basic_c: quietly areg camp_exp_pc before $muni_controls $candidate_controls i.term , absorb(codigo_uf) robust cluster
> ($cluster)

.                                 sum camp_exp_pc if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "2.350"

.                                 estadd local state_fe "\checkmark": reg_broad_basic_c

.                                 estadd local mayor_municipal "\checkmark": reg_broad_basic_c

.         
.         * 1. Broad                              
.                 eststo reg_broad: quietly areg camp_exp_pc before broad before_broad i.term , absorb(codigo_uf) robust cluster($cluster)

.                                 * Add mean dependent variable
.                                 sum camp_exp_pc if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "2.349"

.                                 estadd local state_fe "\checkmark": reg_broad

.                                 lincom before + before_broad

 ( 1)  before + before_broad = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .5259792   .4786654     1.10   0.274    -.4229191    1.474878
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': reg_broad

.                                 estadd local p_value `p_test': reg_broad

. 
.                 *1.2. broad + controls                  
.                 eststo reg_broad_c: quietly areg camp_exp_pc before broad before_broad  $muni_controls $candidate_controls i.term , absorb(codigo_uf) 
> robust cluster($cluster)

.                                 sum camp_exp_pc if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "2.350"

.                                 estadd local state_fe "\checkmark": reg_broad_c

.                                 estadd local mayor_municipal "\checkmark": reg_broad_c

.                                 lincom before + before_broad

 ( 1)  before + before_broad = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .1219445   .5154957     0.24   0.813    -.9000759    1.143965
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': reg_broad_c

.                                 estadd local p_value `p_test': reg_broad_c                              

. 
.         * 2. fraction_broad             
.                 eststo reg_fraction: quietly areg camp_exp_pc before fraction_broad corrupt_before i.term, absorb(codigo_uf) robust  cluster($cluster)

.                                 sum camp_exp_pc if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "2.355"

.                                 estadd local state_fe "\checkmark": reg_fraction

.                                 sum fraction_broad if e(sample), mean 

.                                 loc my_mean: display %9.3f r(mean)                              

.                                 lincom before + corrupt_before * `my_mean'      

 ( 1)  before + 5.71*corrupt_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .1981587   .4852893     0.41   0.684    -.7644102    1.160728
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': reg_fraction

.                                 estadd local p_value `p_test': reg_fraction             

.                                 
.                 *2.2 fraction_broad + controls                  
.                 eststo reg_fraction_c: quietly areg camp_exp_pc before fraction_broad corrupt_before $muni_controls $candidate_controls  i.term, absor
> b(codigo_uf) robust  cluster($cluster)

.                                 sum camp_exp_pc if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "2.356"

.                                 estadd local state_fe "\checkmark": reg_fraction_c

.                                 estadd local mayor_municipal "\checkmark": reg_fraction_c

.                                 sum fraction_broad if e(sample), mean 

.                                 loc my_mean: display %9.3f r(mean)                              

.                                 lincom before + corrupt_before * `my_mean'      

 ( 1)  before + 5.617*corrupt_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |  -.0463175   .5619339    -0.08   0.934    -1.161043    1.068408
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': reg_fraction_c

.                                 estadd local p_value `p_test': reg_fraction_c

.                                                                 
.         * 3. above_median_broad                                                         
.                 eststo reg_median: quietly areg camp_exp_pc before above_median_corrupt median_before i.term, absorb(codigo_uf) robust  cluster($clust
> er)

.                                 sum camp_exp_pc if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "2.355"

.                                 estadd local state_fe "\checkmark": reg_median

.                                 lincom before + median_before

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |    .557282   .6664577     0.84   0.405    -.7646336    1.879198
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': reg_median

.                                 estadd local p_value `p_test': reg_median

. 
.                 *3.2. above_median_broad + controls     (Preferred specification)
.                 eststo reg_median_c: quietly areg camp_exp_pc before above_median_corrupt median_before $muni_controls $candidate_controls i.term, abs
> orb(codigo_uf) robust  cluster($cluster)

.                                 sum camp_exp_pc if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "2.356"

.                                 estadd local state_fe "\checkmark": reg_median_c

.                                 estadd local mayor_municipal "\checkmark": reg_median_c

.                                 lincom before + median_before

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .2858105   .6643624     0.43   0.668    -1.032106    1.603727
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': reg_median_c

.                                 estadd local p_value `p_test': reg_median_c

. 
.         * 4. quartiles broad
.                 eststo reg_quart:   quietly areg camp_exp_pc before quartile2 quartile3 quartile4 quart2_before quart3_before quart4_before i.term, ab
> sorb(codigo_uf) robust cluster($cluster)

.                                 sum camp_exp_pc if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "2.355"

.                                 estadd local state_fe "\checkmark": reg_quart

.                                 lincom before + quart4_before

 ( 1)  before + quart4_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .4232162   .7858378     0.54   0.591    -1.135489    1.981922
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': reg_quart

.                                 estadd local p_value `p_test': reg_quart

. 
.                 *4.2 quartiles broad + controls
.                 eststo reg_quart_c: quietly areg camp_exp_pc before quartile2 quartile3 quartile4 quart2_before quart3_before quart4_before $muni_cont
> rols $candidate_controls   i.term, absorb(codigo_uf) robust  cluster($cluster)

.                                 sum camp_exp_pc if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "2.356"

.                                 estadd local state_fe "\checkmark": reg_quart_c

.                                 estadd local mayor_municipal "\checkmark": reg_quart_c

.                                 lincom before + quart4_before

 ( 1)  before + quart4_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .1503146   .7864168     0.19   0.849    -1.409725    1.710354
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': reg_quart_c

.                                 estadd local p_value `p_test': reg_quart_c

.                                                 
.  
. 
.                                 
. * EXPORT TABLE TO LATEX         
.                 #delimit;
delimiter now ;
.                         esttab reg_broad_basic reg_broad_basic_c reg_broad reg_broad_c reg_fraction reg_fraction_c reg_median reg_median_c reg_quart r
> eg_quart_c
>                         using "tables and figures\table_c17.tex", b(3) se compress label star(* 0.10 ** 0.05 *** 0.01) replace
>                         mgroups( "\shortstack{Information \\ disclosure}" "Corruption"   "Share corruption"  "\shortstack{Median \\ Corruption}"   "\s
> hortstack{Quartiles\\ Corruption}"  , pattern(1 0 1 0 1 0 1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) 
>                         keep(before_broad before broad corrupt_before fraction_broad median_before above_median_corrupt quartile2 quartile3 quartile4 
> quart2_before quart3_before quart4_before ) 
>                         /*scalars("mayor_municipal Mayor and municipal controls" "state_fe State fixed effects")  */
>                         stats(N mD mayor_municipal state_fe r2_a b0_b2 p_value, fmt(%9.0fc %9.3fc ) labels("Observations" "Dep. Var. Mean" "Mayor and 
> municipal controls" "State and term FE" "Adjusted R$^2$" "$\beta_0+\beta_2 \, c_{ist}$" "p-value"))
>                         /*nonum*/ ar2 booktabs nonotes nomtitles title(deletethis) 
>                         substitute(\begin{table}[htbp]\centering \centering \caption{deletethis} /*\footnotesize*/{ \end{tabular} \end{tabular}} \end{
> table} %);
(output written to tables and figures\table_c17.tex)

.                         #delimit cr
delimiter now cr
.                                 
. restore

. eststo clear

. 
end of do-file
C:\Users\75618rpo\Dropbox\Research\Literature Latex\Corruption, accountability and voting\Submission R&R JoP\Replication\replication_package_JOP

. * APPENDIX D
. use "data_brasil_camp.dta", clear

.         
. * Table D.1.
. eststo clear    

. local dep_var "rerun"

. 
.         * 0. Baseline: Average causal Impact of Information Disclosure.
.                 eststo `dep_var'_basic: quietly areg `dep_var' before i.term , absorb(codigo_uf) robust cluster($cluster)

.                                 sum `dep_var' if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "0.708"

.                                 estadd local state_fe "\checkmark": `dep_var'_basic

. 
.                 * 0.1. baseline + controls
.                 eststo `dep_var'_basic_c: quietly areg `dep_var' before $muni_controls $mayor_controls i.term , absorb(codigo_uf) robust cluster($clus
> ter)

.                                 sum `dep_var' if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "0.715"

.                                 estadd local state_fe "\checkmark": `dep_var'_basic_c

.                                 estadd local mayor_municipal "\checkmark": `dep_var'_basic_c

. 
. 
.         * 1. Broad                              
.                 eststo `dep_var'_broad: quietly areg `dep_var' before broad before_broad i.term , absorb(codigo_uf) robust cluster($cluster)

.                                 * Add mean dependent variable
.                                 sum `dep_var' if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "0.708"

.                                 estadd local state_fe "\checkmark": `dep_var'_broad

.                                 lincom before + before_broad

 ( 1)  before + before_broad = 0

------------------------------------------------------------------------------
       rerun | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |  -.0255519   .0299424    -0.85   0.394    -.0842998    .0331961
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': `dep_var'_broad

.                                 estadd local p_value `p_test': `dep_var'_broad

. 
.                 *1.2. broad + controls                  
.                 eststo `dep_var'_broad_c: quietly areg `dep_var' before broad before_broad  $muni_controls $mayor_controls i.term , absorb(codigo_uf) 
> robust cluster($cluster)

.                                 sum `dep_var' if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "0.715"

.                                 estadd local state_fe "\checkmark": `dep_var'_broad_c

.                                 estadd local mayor_municipal "\checkmark": `dep_var'_broad_c

.                                 lincom before + before_broad

 ( 1)  before + before_broad = 0

------------------------------------------------------------------------------
       rerun | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |  -.0269696   .0296926    -0.91   0.364    -.0852278    .0312885
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': `dep_var'_broad_c

.                                 estadd local p_value `p_test': `dep_var'_broad_c                                

. 
.         * 2. fraction_broad             
.                 eststo `dep_var'_fraction: quietly areg `dep_var' before fraction_broad corrupt_before i.term, absorb(codigo_uf) robust  cluster($clus
> ter)

.                                 sum `dep_var' if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "0.713"

.                                 estadd local state_fe "\checkmark": `dep_var'_fraction

.                                 sum fraction_broad if e(sample), mean 

.                                 loc my_mean: display %9.3f r(mean)                              

.                                 lincom before + corrupt_before * `my_mean'      

 ( 1)  before + 4.97*corrupt_before = 0

------------------------------------------------------------------------------
       rerun | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |  -.0189681    .026852    -0.71   0.480     -.071655    .0337188
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': `dep_var'_fraction

.                                 estadd local p_value `p_test': `dep_var'_fraction               

.                                 
.                 *2.2 fraction_broad + controls                  
.                 eststo `dep_var'_fraction_c: quietly areg `dep_var' before fraction_broad corrupt_before $muni_controls $mayor_controls  i.term, absor
> b(codigo_uf) robust  cluster($cluster)

.                                 sum `dep_var' if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "0.718"

.                                 estadd local state_fe "\checkmark": `dep_var'_fraction_c

.                                 estadd local mayor_municipal "\checkmark": `dep_var'_fraction_c

.                                 sum fraction_broad if e(sample), mean 

.                                 loc my_mean: display %9.3f r(mean)                              

.                                 lincom before + corrupt_before * `my_mean'      

 ( 1)  before + 4.915*corrupt_before = 0

------------------------------------------------------------------------------
       rerun | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |  -.0170125   .0266172    -0.64   0.523     -.069239    .0352141
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': `dep_var'_fraction_c

.                                 estadd local p_value `p_test': `dep_var'_fraction_c

.                                                                 
.         * 3. above_median_broad                                                         
.                 eststo `dep_var'_median: quietly areg `dep_var' before above_median_corrupt median_before i.term, absorb(codigo_uf) robust  cluster($c
> luster)

.                                 sum `dep_var' if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "0.713"

.                                 estadd local state_fe "\checkmark": `dep_var'_median

.                                 lincom before + median_before

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
       rerun | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |  -.0586085   .0371059    -1.58   0.115    -.1314148    .0141979
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': `dep_var'_median

.                                 estadd local p_value `p_test': `dep_var'_median

. 
.                 *3.2. above_median_broad + controls     (Preferred specification)
.                 eststo `dep_var'_median_c: quietly areg `dep_var' before above_median_corrupt median_before $muni_controls $mayor_controls i.term, abs
> orb(codigo_uf) robust  cluster($cluster)

.                                 sum `dep_var' if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "0.718"

.                                 estadd local state_fe "\checkmark": `dep_var'_median_c

.                                 estadd local mayor_municipal "\checkmark": `dep_var'_median_c

.                                 lincom before + median_before

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
       rerun | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |  -.0583211   .0366155    -1.59   0.111    -.1301657    .0135234
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': `dep_var'_median_c

.                                 estadd local p_value `p_test': `dep_var'_median_c

. 
.         * 4. quartiles broad
.                 eststo `dep_var'_quart:   quietly areg `dep_var' before quartile2 quartile3 quartile4 quart2_before quart3_before quart4_before i.term
> , absorb(codigo_uf) robust cluster($cluster)

.                                 sum `dep_var' if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "0.713"

.                                 estadd local state_fe "\checkmark": `dep_var'_quart

.                                 lincom before + quart4_before

 ( 1)  before + quart4_before = 0

------------------------------------------------------------------------------
       rerun | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |  -.0484257   .0491559    -0.99   0.325    -.1448757    .0480242
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': `dep_var'_quart

.                                 estadd local p_value `p_test': `dep_var'_quart

. 
.                 *4.2 quartiles broad + controls
.                 eststo `dep_var'_quart_c: quietly areg `dep_var' before quartile2 quartile3 quartile4 quart2_before quart3_before quart4_before $muni_
> controls $mayor_controls   i.term, absorb(codigo_uf) robust  cluster($cluster)

.                                 sum `dep_var' if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "0.718"

.                                 estadd local state_fe "\checkmark": `dep_var'_quart_c

.                                 estadd local mayor_municipal "\checkmark": `dep_var'_quart_c

.                                 lincom before + quart4_before

 ( 1)  before + quart4_before = 0

------------------------------------------------------------------------------
       rerun | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |  -.0397809   .0491268    -0.81   0.418    -.1361743    .0566124
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': `dep_var'_quart_c

.                                 estadd local p_value `p_test': `dep_var'_quart_c

.                                                 
.                                         
. * EXPORT TABLE TO LATEX         
.                 #delimit;
delimiter now ;
.                         esttab `dep_var'_basic `dep_var'_basic_c `dep_var'_broad `dep_var'_broad_c `dep_var'_fraction `dep_var'_fraction_c `dep_var'_m
> edian `dep_var'_median_c `dep_var'_quart `dep_var'_quart_c
>                         using "tables and figures/table_d1.tex", b(3) se compress label star(* 0.10 ** 0.05 *** 0.01) replace
>                         mgroups( "\shortstack{Information \\ disclosure}" "Corruption"   "Share corruption"  "\shortstack{Median \\ Corruption}"   "\s
> hortstack{Quartiles\\ Corruption}"  , pattern(1 0 1 0 1 0 1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) 
>                         keep(before_broad before broad corrupt_before fraction_broad median_before above_median_corrupt quartile2 quartile3 quartile4 
> quart2_before quart3_before quart4_before ) 
>                         stats(N mD mayor_municipal state_fe r2_a b0_b2 p_value, fmt(%9.0fc %9.3fc ) labels("Observations" "Dep. Var. Mean" "Mayor and 
> municipal controls" "State and term FE" "Adjusted R$^2$" "$\beta_0+\beta_2 \, c_{ist}$" "p-value"))
>                         /*nonum*/ ar2 booktabs nonotes nomtitles title(deletethis) 
>                         substitute(\begin{table}[htbp]\centering \centering \caption{deletethis} /*\footnotesize*/{ \end{tabular} \end{tabular}} \end{
> table} %);
(output written to tables and figures/table_d1.tex)

.                         #delimit cr
delimiter now cr
. 
. 
. 
. 
. * Table D.2
.  eststo clear   

. foreach dep_var of varlist total_cand {
  2.  
. 
.         * 0. Baseline: Average causal Impact of Information Disclosure.
.                 eststo `dep_var'_basic: quietly areg `dep_var' before i.term , absorb(codigo_uf) robust cluster($cluster)
  3.                                 sum camp_exp_pc if e(sample), mean 
  4.                                 loc mymean: display %9.3f r(mean)       
  5.                                 estadd local mD `mymean', replace       
  6.                                 estadd local state_fe "\checkmark": `dep_var'_basic
  7. 
.                 * 0.1. baseline + controls
.                 eststo `dep_var'_basic_c: quietly areg `dep_var' before $muni_controls $mayor_controls i.term , absorb(codigo_uf) robust cluster($clus
> ter)
  8.                                 sum camp_exp_pc if e(sample), mean 
  9.                                 loc mymean: display %9.3f r(mean)       
 10.                                 estadd local mD `mymean', replace       
 11.                                 estadd local state_fe "\checkmark": `dep_var'_basic_c
 12.                                 estadd local mayor_municipal "\checkmark": `dep_var'_basic_c
 13.         
.         * 1. Broad                              
.                 eststo `dep_var'_broad: quietly areg `dep_var' before broad before_broad i.term , absorb(codigo_uf) robust cluster($cluster)
 14.                                 * Add mean dependent variable
.                                 sum camp_exp_pc if e(sample), mean 
 15.                                 loc mymean: display %9.3f r(mean)       
 16.                                 estadd local mD `mymean', replace       
 17.                                 estadd local state_fe "\checkmark": `dep_var'_broad
 18.                                 lincom before + before_broad
 19.                                 local estimate: display %9.3f r(estimate)
 20.                                 local p_test: display %9.3f r(p)
 21.                                 estadd local b0_b2 `estimate': `dep_var'_broad
 22.                                 estadd local p_value `p_test': `dep_var'_broad
 23. 
.                 *1.2. broad + controls                  
.                 eststo `dep_var'_broad_c: quietly areg `dep_var' before broad before_broad  $muni_controls $mayor_controls i.term , absorb(codigo_uf) 
> robust cluster($cluster)
 24.                                 sum camp_exp_pc if e(sample), mean 
 25.                                 loc mymean: display %9.3f r(mean)       
 26.                                 estadd local mD `mymean', replace       
 27.                                 estadd local state_fe "\checkmark": `dep_var'_broad_c
 28.                                 estadd local mayor_municipal "\checkmark": `dep_var'_broad_c
 29.                                 lincom before + before_broad
 30.                                 local estimate: display %9.3f r(estimate)
 31.                                 local p_test: display %9.3f r(p)
 32.                                 estadd local b0_b2 `estimate': `dep_var'_broad_c
 33.                                 estadd local p_value `p_test': `dep_var'_broad_c                                
 34. 
.         * 2. fraction_broad             
.                 eststo `dep_var'_fraction: quietly areg `dep_var' before fraction_broad corrupt_before i.term, absorb(codigo_uf) robust  cluster($clus
> ter)
 35.                                 sum camp_exp_pc if e(sample), mean 
 36.                                 loc mymean: display %9.3f r(mean)       
 37.                                 estadd local mD `mymean', replace       
 38.                                 estadd local state_fe "\checkmark": `dep_var'_fraction
 39.                                 sum fraction_broad if e(sample), mean 
 40.                                 loc my_mean: display %9.3f r(mean)                              
 41.                                 lincom before + corrupt_before * `my_mean'      
 42.                                 local estimate: display %9.3f r(estimate)
 43.                                 local p_test: display %9.3f r(p)
 44.                                 estadd local b0_b2 `estimate': `dep_var'_fraction
 45.                                 estadd local p_value `p_test': `dep_var'_fraction               
 46.                                 
.                 *2.2 fraction_broad + controls                  
.                 eststo `dep_var'_fraction_c: quietly areg `dep_var' before fraction_broad corrupt_before $muni_controls $mayor_controls  i.term, absor
> b(codigo_uf) robust  cluster($cluster)
 47.                                 sum camp_exp_pc if e(sample), mean 
 48.                                 loc mymean: display %9.3f r(mean)       
 49.                                 estadd local mD `mymean', replace       
 50.                                 estadd local state_fe "\checkmark": `dep_var'_fraction_c
 51.                                 estadd local mayor_municipal "\checkmark": `dep_var'_fraction_c
 52.                                 sum fraction_broad if e(sample), mean 
 53.                                 loc my_mean: display %9.3f r(mean)                              
 54.                                 lincom before + corrupt_before * `my_mean'      
 55.                                 local estimate: display %9.3f r(estimate)
 56.                                 local p_test: display %9.3f r(p)
 57.                                 estadd local b0_b2 `estimate': `dep_var'_fraction_c
 58.                                 estadd local p_value `p_test': `dep_var'_fraction_c
 59.                                                         
.         * 3. above_median_broad                                                         
.                 eststo `dep_var'_median: quietly areg `dep_var' before above_median_corrupt median_before i.term, absorb(codigo_uf) robust  cluster($c
> luster)
 60.                                 sum camp_exp_pc if e(sample), mean 
 61.                                 loc mymean: display %9.3f r(mean)       
 62.                                 estadd local mD `mymean', replace       
 63.                                 estadd local state_fe "\checkmark": `dep_var'_median
 64.                                 lincom before + median_before
 65.                                 local estimate: display %9.3f r(estimate)
 66.                                 local p_test: display %9.3f r(p)
 67.                                 estadd local b0_b2 `estimate': `dep_var'_median
 68.                                 estadd local p_value `p_test': `dep_var'_median
 69. 
.                 *3.2. above_median_broad + controls     (Preferred specification)
.                 eststo `dep_var'_median_c: quietly areg `dep_var' before above_median_corrupt median_before $muni_controls $mayor_controls i.term, abs
> orb(codigo_uf) robust  cluster($cluster)
 70.                                 sum camp_exp_pc if e(sample), mean 
 71.                                 loc mymean: display %9.3f r(mean)       
 72.                                 estadd local mD `mymean', replace       
 73.                                 estadd local state_fe "\checkmark": `dep_var'_median_c
 74.                                 estadd local mayor_municipal "\checkmark": `dep_var'_median_c
 75.                                 lincom before + median_before
 76.                                 local estimate: display %9.3f r(estimate)
 77.                                 local p_test: display %9.3f r(p)
 78.                                 estadd local b0_b2 `estimate': `dep_var'_median_c
 79.                                 estadd local p_value `p_test': `dep_var'_median_c
 80. 
.         * 4. quartiles broad
.                 eststo `dep_var'_quart:   quietly areg `dep_var' before quartile2 quartile3 quartile4 quart2_before quart3_before quart4_before i.term
> , absorb(codigo_uf) robust cluster($cluster)
 81.                                 sum camp_exp_pc if e(sample), mean 
 82.                                 loc mymean: display %9.3f r(mean)       
 83.                                 estadd local mD `mymean', replace       
 84.                                 estadd local state_fe "\checkmark": `dep_var'_quart
 85.                                 lincom before + quart4_before
 86.                                 local estimate: display %9.3f r(estimate)
 87.                                 local p_test: display %9.3f r(p)
 88.                                 estadd local b0_b2 `estimate': `dep_var'_quart
 89.                                 estadd local p_value `p_test': `dep_var'_quart
 90. 
.                 *4.2 quartiles broad + controls
.                 eststo `dep_var'_quart_c: quietly areg `dep_var' before quartile2 quartile3 quartile4 quart2_before quart3_before quart4_before $muni_
> controls $mayor_controls   i.term, absorb(codigo_uf) robust  cluster($cluster)
 91.                                 sum camp_exp_pc if e(sample), mean 
 92.                                 loc mymean: display %9.3f r(mean)       
 93.                                 estadd local mD `mymean', replace       
 94.                                 estadd local state_fe "\checkmark": `dep_var'_quart_c
 95.                                 estadd local mayor_municipal "\checkmark": `dep_var'_quart_c
 96.                                 lincom before + quart4_before
 97.                                 local estimate: display %9.3f r(estimate)
 98.                                 local p_test: display %9.3f r(p)
 99.                                 estadd local b0_b2 `estimate': `dep_var'_quart_c
100.                                 estadd local p_value `p_test': `dep_var'_quart_c
101. 
. * total_cand mean_educ mean_skilled mean_age 
.                         esttab `dep_var'_basic `dep_var'_basic_c `dep_var'_broad `dep_var'_broad_c `dep_var'_fraction `dep_var'_fraction_c `dep_var'_m
> edian `dep_var'_median_c `dep_var'_quart `dep_var'_quart_c ///
>                         using "tables and figures\table_d2.tex", b(3) se compress label star(* 0.10 ** 0.05 *** 0.01) replace ///
>                         mgroups( "\shortstack{Information \\ disclosure}" "Corruption"   "Share corruption"  "\shortstack{Median \\ Corruption}"   "\s
> hortstack{Quartiles\\ Corruption}"  , pattern(1 0 1 0 1 0 1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))  ///
>                         keep(before_broad before broad corrupt_before fraction_broad median_before above_median_corrupt quartile2 quartile3 quartile4 
> quart2_before quart3_before quart4_before ) /// 
>                         stats(N mD mayor_municipal state_fe r2_a b0_b2 p_value, fmt(%9.0fc %9.3fc ) labels("Observations" "Dep. Var. Mean" "Mayor and 
> municipal controls" "State and term FE" "Adjusted R$^2$" "$\beta_0+\beta_2 \, c_{ist}$" "p-value")) ///
>                         /*nonum*/ ar2 booktabs nonotes nomtitles title(deletethis) ///
>                         substitute(\begin{table}[htbp]\centering \centering \caption{deletethis} /*\footnotesize*/{ \end{tabular} \end{tabular}} \end{
> table} %)
102. 
. }

added macro:
                 e(mD) : "2.870"

added macro:
                 e(mD) : "2.870"

added macro:
                 e(mD) : "2.870"

 ( 1)  before + before_broad = 0

------------------------------------------------------------------------------
  total_cand | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |  -.0485553   .0644989    -0.75   0.452    -.1751041    .0779935
------------------------------------------------------------------------------

added macro:
                 e(mD) : "2.870"

 ( 1)  before + before_broad = 0

------------------------------------------------------------------------------
  total_cand | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   -.059698    .061558    -0.97   0.332    -.1804774    .0610814
------------------------------------------------------------------------------

added macro:
                 e(mD) : "2.854"

 ( 1)  before + 4.97*corrupt_before = 0

------------------------------------------------------------------------------
  total_cand | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |  -.0275721   .0583502    -0.47   0.637    -.1420624    .0869182
------------------------------------------------------------------------------

added macro:
                 e(mD) : "2.854"

 ( 1)  before + 4.915*corrupt_before = 0

------------------------------------------------------------------------------
  total_cand | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |  -.0496583   .0554996    -0.89   0.371     -.158556    .0592394
------------------------------------------------------------------------------

added macro:
                 e(mD) : "2.854"

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
  total_cand | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |  -.0117132   .0786384    -0.15   0.882    -.1660115     .142585
------------------------------------------------------------------------------

added macro:
                 e(mD) : "2.854"

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
  total_cand | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   -.009773   .0767021    -0.13   0.899    -.1602728    .1407268
------------------------------------------------------------------------------

added macro:
                 e(mD) : "2.854"

 ( 1)  before + quart4_before = 0

------------------------------------------------------------------------------
  total_cand | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .0299278   .1136439     0.26   0.792    -.1930556    .2529112
------------------------------------------------------------------------------

added macro:
                 e(mD) : "2.854"

 ( 1)  before + quart4_before = 0

------------------------------------------------------------------------------
  total_cand | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |    .030445   .1076963     0.28   0.777    -.1808697    .2417596
------------------------------------------------------------------------------
(output written to tables and figures\table_d2.tex)

. 
. * table d.3
.  eststo clear   

. foreach dep_var of varlist mean_educ {
  2.  
. 
.         * 0. Baseline: Average causal Impact of Information Disclosure.
.                 eststo `dep_var'_basic: quietly areg `dep_var' before i.term , absorb(codigo_uf) robust cluster($cluster)
  3.                                 sum camp_exp_pc if e(sample), mean 
  4.                                 loc mymean: display %9.3f r(mean)       
  5.                                 estadd local mD `mymean', replace       
  6.                                 estadd local state_fe "\checkmark": `dep_var'_basic
  7. 
.                 * 0.1. baseline + controls
.                 eststo `dep_var'_basic_c: quietly areg `dep_var' before $muni_controls $mayor_controls i.term , absorb(codigo_uf) robust cluster($clus
> ter)
  8.                                 sum camp_exp_pc if e(sample), mean 
  9.                                 loc mymean: display %9.3f r(mean)       
 10.                                 estadd local mD `mymean', replace       
 11.                                 estadd local state_fe "\checkmark": `dep_var'_basic_c
 12.                                 estadd local mayor_municipal "\checkmark": `dep_var'_basic_c
 13.         
.         * 1. Broad                              
.                 eststo `dep_var'_broad: quietly areg `dep_var' before broad before_broad i.term , absorb(codigo_uf) robust cluster($cluster)
 14.                                 * Add mean dependent variable
.                                 sum camp_exp_pc if e(sample), mean 
 15.                                 loc mymean: display %9.3f r(mean)       
 16.                                 estadd local mD `mymean', replace       
 17.                                 estadd local state_fe "\checkmark": `dep_var'_broad
 18.                                 lincom before + before_broad
 19.                                 local estimate: display %9.3f r(estimate)
 20.                                 local p_test: display %9.3f r(p)
 21.                                 estadd local b0_b2 `estimate': `dep_var'_broad
 22.                                 estadd local p_value `p_test': `dep_var'_broad
 23. 
.                 *1.2. broad + controls                  
.                 eststo `dep_var'_broad_c: quietly areg `dep_var' before broad before_broad  $muni_controls $mayor_controls i.term , absorb(codigo_uf) 
> robust cluster($cluster)
 24.                                 sum camp_exp_pc if e(sample), mean 
 25.                                 loc mymean: display %9.3f r(mean)       
 26.                                 estadd local mD `mymean', replace       
 27.                                 estadd local state_fe "\checkmark": `dep_var'_broad_c
 28.                                 estadd local mayor_municipal "\checkmark": `dep_var'_broad_c
 29.                                 lincom before + before_broad
 30.                                 local estimate: display %9.3f r(estimate)
 31.                                 local p_test: display %9.3f r(p)
 32.                                 estadd local b0_b2 `estimate': `dep_var'_broad_c
 33.                                 estadd local p_value `p_test': `dep_var'_broad_c                                
 34. 
.         * 2. fraction_broad             
.                 eststo `dep_var'_fraction: quietly areg `dep_var' before fraction_broad corrupt_before i.term, absorb(codigo_uf) robust  cluster($clus
> ter)
 35.                                 sum camp_exp_pc if e(sample), mean 
 36.                                 loc mymean: display %9.3f r(mean)       
 37.                                 estadd local mD `mymean', replace       
 38.                                 estadd local state_fe "\checkmark": `dep_var'_fraction
 39.                                 sum fraction_broad if e(sample), mean 
 40.                                 loc my_mean: display %9.3f r(mean)                              
 41.                                 lincom before + corrupt_before * `my_mean'      
 42.                                 local estimate: display %9.3f r(estimate)
 43.                                 local p_test: display %9.3f r(p)
 44.                                 estadd local b0_b2 `estimate': `dep_var'_fraction
 45.                                 estadd local p_value `p_test': `dep_var'_fraction               
 46.                                 
.                 *2.2 fraction_broad + controls                  
.                 eststo `dep_var'_fraction_c: quietly areg `dep_var' before fraction_broad corrupt_before $muni_controls $mayor_controls  i.term, absor
> b(codigo_uf) robust  cluster($cluster)
 47.                                 sum camp_exp_pc if e(sample), mean 
 48.                                 loc mymean: display %9.3f r(mean)       
 49.                                 estadd local mD `mymean', replace       
 50.                                 estadd local state_fe "\checkmark": `dep_var'_fraction_c
 51.                                 estadd local mayor_municipal "\checkmark": `dep_var'_fraction_c
 52.                                 sum fraction_broad if e(sample), mean 
 53.                                 loc my_mean: display %9.3f r(mean)                              
 54.                                 lincom before + corrupt_before * `my_mean'      
 55.                                 local estimate: display %9.3f r(estimate)
 56.                                 local p_test: display %9.3f r(p)
 57.                                 estadd local b0_b2 `estimate': `dep_var'_fraction_c
 58.                                 estadd local p_value `p_test': `dep_var'_fraction_c
 59.                                                         
.         * 3. above_median_broad                                                         
.                 eststo `dep_var'_median: quietly areg `dep_var' before above_median_corrupt median_before i.term, absorb(codigo_uf) robust  cluster($c
> luster)
 60.                                 sum camp_exp_pc if e(sample), mean 
 61.                                 loc mymean: display %9.3f r(mean)       
 62.                                 estadd local mD `mymean', replace       
 63.                                 estadd local state_fe "\checkmark": `dep_var'_median
 64.                                 lincom before + median_before
 65.                                 local estimate: display %9.3f r(estimate)
 66.                                 local p_test: display %9.3f r(p)
 67.                                 estadd local b0_b2 `estimate': `dep_var'_median
 68.                                 estadd local p_value `p_test': `dep_var'_median
 69. 
.                 *3.2. above_median_broad + controls     (Preferred specification)
.                 eststo `dep_var'_median_c: quietly areg `dep_var' before above_median_corrupt median_before $muni_controls $mayor_controls i.term, abs
> orb(codigo_uf) robust  cluster($cluster)
 70.                                 sum camp_exp_pc if e(sample), mean 
 71.                                 loc mymean: display %9.3f r(mean)       
 72.                                 estadd local mD `mymean', replace       
 73.                                 estadd local state_fe "\checkmark": `dep_var'_median_c
 74.                                 estadd local mayor_municipal "\checkmark": `dep_var'_median_c
 75.                                 lincom before + median_before
 76.                                 local estimate: display %9.3f r(estimate)
 77.                                 local p_test: display %9.3f r(p)
 78.                                 estadd local b0_b2 `estimate': `dep_var'_median_c
 79.                                 estadd local p_value `p_test': `dep_var'_median_c
 80. 
.         * 4. quartiles broad
.                 eststo `dep_var'_quart:   quietly areg `dep_var' before quartile2 quartile3 quartile4 quart2_before quart3_before quart4_before i.term
> , absorb(codigo_uf) robust cluster($cluster)
 81.                                 sum camp_exp_pc if e(sample), mean 
 82.                                 loc mymean: display %9.3f r(mean)       
 83.                                 estadd local mD `mymean', replace       
 84.                                 estadd local state_fe "\checkmark": `dep_var'_quart
 85.                                 lincom before + quart4_before
 86.                                 local estimate: display %9.3f r(estimate)
 87.                                 local p_test: display %9.3f r(p)
 88.                                 estadd local b0_b2 `estimate': `dep_var'_quart
 89.                                 estadd local p_value `p_test': `dep_var'_quart
 90. 
.                 *4.2 quartiles broad + controls
.                 eststo `dep_var'_quart_c: quietly areg `dep_var' before quartile2 quartile3 quartile4 quart2_before quart3_before quart4_before $muni_
> controls $mayor_controls   i.term, absorb(codigo_uf) robust  cluster($cluster)
 91.                                 sum camp_exp_pc if e(sample), mean 
 92.                                 loc mymean: display %9.3f r(mean)       
 93.                                 estadd local mD `mymean', replace       
 94.                                 estadd local state_fe "\checkmark": `dep_var'_quart_c
 95.                                 estadd local mayor_municipal "\checkmark": `dep_var'_quart_c
 96.                                 lincom before + quart4_before
 97.                                 local estimate: display %9.3f r(estimate)
 98.                                 local p_test: display %9.3f r(p)
 99.                                 estadd local b0_b2 `estimate': `dep_var'_quart_c
100.                                 estadd local p_value `p_test': `dep_var'_quart_c
101. 
. * total_cand mean_educ mean_skilled mean_age 
.                         esttab `dep_var'_basic `dep_var'_basic_c `dep_var'_broad `dep_var'_broad_c `dep_var'_fraction `dep_var'_fraction_c `dep_var'_m
> edian `dep_var'_median_c `dep_var'_quart `dep_var'_quart_c ///
>                         using "tables and figures\table_d3.tex", b(3) se compress label star(* 0.10 ** 0.05 *** 0.01) replace ///
>                         mgroups( "\shortstack{Information \\ disclosure}" "Corruption"   "Share corruption"  "\shortstack{Median \\ Corruption}"   "\s
> hortstack{Quartiles\\ Corruption}"  , pattern(1 0 1 0 1 0 1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))  ///
>                         keep(before_broad before broad corrupt_before fraction_broad median_before above_median_corrupt quartile2 quartile3 quartile4 
> quart2_before quart3_before quart4_before ) /// 
>                         stats(N mD mayor_municipal state_fe r2_a b0_b2 p_value, fmt(%9.0fc %9.3fc ) labels("Observations" "Dep. Var. Mean" "Mayor and 
> municipal controls" "State and term FE" "Adjusted R$^2$" "$\beta_0+\beta_2 \, c_{ist}$" "p-value")) ///
>                         /*nonum*/ ar2 booktabs nonotes nomtitles title(deletethis) ///
>                         substitute(\begin{table}[htbp]\centering \centering \caption{deletethis} /*\footnotesize*/{ \end{tabular} \end{tabular}} \end{
> table} %)
102. 
. }

added macro:
                 e(mD) : "2.883"

added macro:
                 e(mD) : "2.883"

added macro:
                 e(mD) : "2.883"

 ( 1)  before + before_broad = 0

------------------------------------------------------------------------------
   mean_educ | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |  -.0095046    .098931    -0.10   0.923    -.2036131     .184604
------------------------------------------------------------------------------

added macro:
                 e(mD) : "2.883"

 ( 1)  before + before_broad = 0

------------------------------------------------------------------------------
   mean_educ | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |  -.0072017   .0940119    -0.08   0.939    -.1916597    .1772564
------------------------------------------------------------------------------

added macro:
                 e(mD) : "2.867"

 ( 1)  before + 4.905*corrupt_before = 0

------------------------------------------------------------------------------
   mean_educ | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |  -.0139616   .0917691    -0.15   0.879    -.1940265    .1661033
------------------------------------------------------------------------------

added macro:
                 e(mD) : "2.867"

 ( 1)  before + 4.849*corrupt_before = 0

------------------------------------------------------------------------------
   mean_educ | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |  -.0145235   .0871719    -0.17   0.868    -.1855692    .1565223
------------------------------------------------------------------------------

added macro:
                 e(mD) : "2.867"

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
   mean_educ | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   -.035838   .1202931    -0.30   0.766    -.2718714    .2001954
------------------------------------------------------------------------------

added macro:
                 e(mD) : "2.867"

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
   mean_educ | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |  -.0095601   .1149543    -0.08   0.934    -.2351193    .2159992
------------------------------------------------------------------------------

added macro:
                 e(mD) : "2.867"

 ( 1)  before + quart4_before = 0

------------------------------------------------------------------------------
   mean_educ | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .0664848   .1755674     0.38   0.705    -.2780053     .410975
------------------------------------------------------------------------------

added macro:
                 e(mD) : "2.867"

 ( 1)  before + quart4_before = 0

------------------------------------------------------------------------------
   mean_educ | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .1081067   .1657665     0.65   0.514    -.2171544    .4333679
------------------------------------------------------------------------------
(output written to tables and figures\table_d3.tex)

. 
.  
.          
. * Table D.4
. 
. gen preselection_auditing = 0

.         replace preselection_auditing = 1 if month3_12 == 1
(250 real changes made)

.         
.                 label var preselection_auditing "Preselection Auditing"

.                 capture gen preselection_auditing_broad = preselection_auditing * broad

.                                 label var preselection_auditing_broad "Preselection Auditing $\times$ corruption"

.                                 label var broad "Corruption"

.                                 
.                 capture gen corrupt_preselection_auditing = preselection_auditing * fraction_broad

.                                 label var corrupt_preselection_auditing "Preselection Auditing $\times$ share corruption"

.                                 label var fraction_broad "Share corruption"

.                 
.                 capture gen median_preselection_auditing = preselection_auditing * above_median_corrupt

.                                 label var median_preselection_auditing "Preselection Auditing $\times$ Above median corruption"

.         
.                   gen quart2_preselection_auditing = preselection_auditing * quartile2
(78 missing values generated)

.                   gen quart3_preselection_auditing = preselection_auditing * quartile3
(78 missing values generated)

.                   gen quart4_preselection_auditing = preselection_auditing * quartile4
(78 missing values generated)

.                                 label var quart2_preselection_auditing "Preselection Auditing $\times$ 2nd quartile of corruption"

.                                 label var quart3_preselection_auditing "Preselection Auditing $\times$ 3rd quartile of corruption"

.                                 label var quart4_preselection_auditing "Preselection Auditing $\times$ 4th quartile of corruption"

.                                 label var quartile1 "1st quartile of corruption"

.                                 label var quartile2 "2nd quartile of corruption"

.                                 label var quartile3 "3rd quartile of corruption"

.                                 label var quartile4 "4th quartile of corruption"        

. 
. eststo clear    

. local dep_var "rerun"

. 
.         * 0. Baseline: Average causal Impact of Information Disclosure.
.                 eststo `dep_var'_basic: quietly areg `dep_var' preselection_auditing i.term , absorb(codigo_uf) robust cluster($cluster)

.                                 sum `dep_var' if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "0.708"

.                                 estadd local state_fe "\checkmark": `dep_var'_basic

. 
.                 * 0.1. baseline + controls
.                 eststo `dep_var'_basic_c: quietly areg `dep_var' preselection_auditing $muni_controls $mayor_controls i.term , absorb(codigo_uf) robus
> t cluster($cluster)

.                                 sum `dep_var' if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "0.715"

.                                 estadd local state_fe "\checkmark": `dep_var'_basic_c

.                                 estadd local mayor_municipal "\checkmark": `dep_var'_basic_c

.         
.         * 1. Broad                              
.                 eststo `dep_var'_broad: quietly areg `dep_var' preselection_auditing broad preselection_auditing_broad i.term , absorb(codigo_uf) robu
> st cluster($cluster)

.                                 * Add mean dependent variable
.                                 sum `dep_var' if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "0.708"

.                                 estadd local state_fe "\checkmark": `dep_var'_broad

.                                 lincom preselection_auditing + preselection_auditing_broad

 ( 1)  preselection_auditing + preselection_auditing_broad = 0

------------------------------------------------------------------------------
       rerun | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .0238661   .0341754     0.70   0.485    -.0431871    .0909193
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': `dep_var'_broad

.                                 estadd local p_value `p_test': `dep_var'_broad

. 
.                 *1.2. broad + controls                  
.                 eststo `dep_var'_broad_c: quietly areg `dep_var' preselection_auditing broad preselection_auditing_broad  $muni_controls $mayor_contro
> ls i.term , absorb(codigo_uf) robust cluster($cluster)

.                                 sum `dep_var' if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "0.715"

.                                 estadd local state_fe "\checkmark": `dep_var'_broad_c

.                                 estadd local mayor_municipal "\checkmark": `dep_var'_broad_c

.                                 lincom preselection_auditing + preselection_auditing_broad

 ( 1)  preselection_auditing + preselection_auditing_broad = 0

------------------------------------------------------------------------------
       rerun | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .0272887   .0347222     0.79   0.432    -.0408377    .0954151
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': `dep_var'_broad_c

.                                 estadd local p_value `p_test': `dep_var'_broad_c                                

. 
.         * 2. fraction_broad             
.                 eststo `dep_var'_fraction: quietly areg `dep_var' preselection_auditing fraction_broad corrupt_preselection_auditing i.term, absorb(co
> digo_uf) robust  cluster($cluster)

.                                 sum `dep_var' if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "0.713"

.                                 estadd local state_fe "\checkmark": `dep_var'_fraction

.                                 sum fraction_broad if e(sample), mean 

.                                 loc my_mean: display %9.3f r(mean)                              

.                                 lincom preselection_auditing + corrupt_preselection_auditing * `my_mean'        

 ( 1)  preselection_auditing + 4.97*corrupt_preselection_auditing = 0

------------------------------------------------------------------------------
       rerun | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .0253805   .0309596     0.82   0.413    -.0353661    .0861271
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': `dep_var'_fraction

.                                 estadd local p_value `p_test': `dep_var'_fraction               

.                                 
.                 *2.2 fraction_broad + controls                  
.                 eststo `dep_var'_fraction_c: quietly areg `dep_var' preselection_auditing fraction_broad corrupt_preselection_auditing $muni_controls 
> $mayor_controls  i.term, absorb(codigo_uf) robust  cluster($cluster)

.                                 sum `dep_var' if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "0.718"

.                                 estadd local state_fe "\checkmark": `dep_var'_fraction_c

.                                 estadd local mayor_municipal "\checkmark": `dep_var'_fraction_c

.                                 sum fraction_broad if e(sample), mean 

.                                 loc my_mean: display %9.3f r(mean)                              

.                                 lincom preselection_auditing + corrupt_preselection_auditing * `my_mean'        

 ( 1)  preselection_auditing + 4.915*corrupt_preselection_auditing = 0

------------------------------------------------------------------------------
       rerun | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .0239828   .0311717     0.77   0.442    -.0371804    .0851459
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': `dep_var'_fraction_c

.                                 estadd local p_value `p_test': `dep_var'_fraction_c

.                                                                 
.         * 3. above_median_broad                                                         
.                 eststo `dep_var'_median: quietly areg `dep_var' preselection_auditing above_median_corrupt median_preselection_auditing i.term, absorb
> (codigo_uf) robust  cluster($cluster)

.                                 sum `dep_var' if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "0.713"

.                                 estadd local state_fe "\checkmark": `dep_var'_median

.                                 lincom preselection_auditing + median_preselection_auditing

 ( 1)  preselection_auditing + median_preselection_auditing = 0

------------------------------------------------------------------------------
       rerun | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |  -.0206117   .0436947    -0.47   0.637     -.106346    .0651226
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': `dep_var'_median

.                                 estadd local p_value `p_test': `dep_var'_median

. 
.                 *3.2. above_median_broad + controls     (Preferred specification)
.                 eststo `dep_var'_median_c: quietly areg `dep_var' preselection_auditing above_median_corrupt median_preselection_auditing $muni_contro
> ls $mayor_controls i.term, absorb(codigo_uf) robust  cluster($cluster)

.                                 sum `dep_var' if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "0.718"

.                                 estadd local state_fe "\checkmark": `dep_var'_median_c

.                                 estadd local mayor_municipal "\checkmark": `dep_var'_median_c

.                                 lincom preselection_auditing + median_preselection_auditing

 ( 1)  preselection_auditing + median_preselection_auditing = 0

------------------------------------------------------------------------------
       rerun | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |  -.0157969   .0441258    -0.36   0.720    -.1023776    .0707839
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': `dep_var'_median_c

.                                 estadd local p_value `p_test': `dep_var'_median_c

. 
.         * 4. quartiles broad
.                 eststo `dep_var'_quart:   quietly areg `dep_var' preselection_auditing quartile2 quartile3 quartile4 quart2_preselection_auditing quar
> t3_preselection_auditing quart4_preselection_auditing i.term, absorb(codigo_uf) robust cluster($cluster)

.                                 sum `dep_var' if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "0.713"

.                                 estadd local state_fe "\checkmark": `dep_var'_quart

.                                 lincom preselection_auditing + quart4_preselection_auditing

 ( 1)  preselection_auditing + quart4_preselection_auditing = 0

------------------------------------------------------------------------------
       rerun | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |  -.0351822   .0579856    -0.61   0.544    -.1489572    .0785927
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': `dep_var'_quart

.                                 estadd local p_value `p_test': `dep_var'_quart

. 
.                 *4.2 quartiles broad + controls
.                 eststo `dep_var'_quart_c: quietly areg `dep_var' preselection_auditing quartile2 quartile3 quartile4 quart2_preselection_auditing quar
> t3_preselection_auditing quart4_preselection_auditing $muni_controls $mayor_controls   i.term, absorb(codigo_uf) robust  cluster($cluster)

.                                 sum `dep_var' if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "0.718"

.                                 estadd local state_fe "\checkmark": `dep_var'_quart_c

.                                 estadd local mayor_municipal "\checkmark": `dep_var'_quart_c

.                                 lincom preselection_auditing + quart4_preselection_auditing

 ( 1)  preselection_auditing + quart4_preselection_auditing = 0

------------------------------------------------------------------------------
       rerun | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |  -.0217685     .06002    -0.36   0.717    -.1395358    .0959987
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': `dep_var'_quart_c

.                                 estadd local p_value `p_test': `dep_var'_quart_c

.                                                 
.                                         
. * EXPORT TABLE TO LATEX         
.                 #delimit;
delimiter now ;
.                         esttab `dep_var'_basic `dep_var'_basic_c `dep_var'_broad `dep_var'_broad_c `dep_var'_fraction `dep_var'_fraction_c `dep_var'_m
> edian `dep_var'_median_c `dep_var'_quart `dep_var'_quart_c
>                         using "tables and figures\table_d4.tex", b(3) se compress label star(* 0.10 ** 0.05 *** 0.01) replace
>                         mgroups( "\shortstack{Information \\ disclosure}" "Corruption"   "Share corruption"  "\shortstack{Median \\ Corruption}"   "\s
> hortstack{Quartiles\\ Corruption}"  , pattern(1 0 1 0 1 0 1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) 
>                         keep(preselection_auditing_broad preselection_auditing broad corrupt_preselection_auditing fraction_broad median_preselection_
> auditing above_median_corrupt quartile2 quartile3 quartile4 quart2_preselection_auditing quart3_preselection_auditing quart4_preselection_auditing ) 
>                         /*scalars("mayor_municipal Mayor and municipal controls" "state_fe State fixed effects")  */
>                         stats(N mD mayor_municipal state_fe r2_a b0_b2 p_value, fmt(%9.0fc %9.3fc ) labels("Observations" "Dep. Var. Mean" "Mayor and 
> municipal controls" "State and term FE" "Adjusted R$^2$" "$\beta_0+\beta_2 \, c_{ist}$" "p-value"))
>                         /*nonum*/ ar2 booktabs nonotes nomtitles title(deletethis) 
>                         substitute(\begin{table}[htbp]\centering \centering \caption{deletethis} /*\footnotesize*/{ \end{tabular} \end{tabular}} \end{
> table} %);
(output written to tables and figures\table_d4.tex)

.                         #delimit cr
delimiter now cr
. 
. 
.                         
.                         
. * Figure D.1
. graph bar camp_propa_pc camp_pessoal_pc camp_gas_pc camp_bens_pc camp_serv_pc  camp_baixa_pc camp_nonspe_pc camp_outraexp_pc , graphregion(color(white
> ))  scheme(s2Mono)        legend(label(1 "Advertising")  label(2 "Staff") label(3 "Utilities") label(4 "Leased assets") label(5 "Third Parties") label
> (6 "Cash") label(7 "Not specified")  label(8 "Others") cols(4)) 

. graph export "tables and figures\figure_d1a.tif", replace
file tables and figures\figure_d1a.tif saved as TIFF format

.  
. 
. graph bar (mean) camp_prop_pc camp_pessoas_pc camp_firm_pc camp_outrainc_pc,  graphregion(color(white)) scheme(s2Mono)  legend(label(1 "Own resources"
> ) label(2 "Donations from people") label(3 "Donations from firms") label(4 "Others")) 

. graph export "tables and figures\figure_d1b.tif", replace
file tables and figures\figure_d1b.tif saved as TIFF format

.  
.  
. * Table D5
.         
.         foreach dep_var of varlist camp_propa_pc camp_pessoal_pc camp_gas_pc camp_bens_pc camp_serv_pc camp_baixa_pc camp_nonspe_pc camp_outraexp_pc {
  2.                         eststo r_`dep_var': quietly areg `dep_var' before above_median_corrupt median_before $muni_controls $mayor_controls i.term 
> if sample_camp_exp == 1, absorb(codigo_uf) robust  cluster($cluster)
  3.                                 sum `dep_var' if e(sample), mean 
  4.                                 loc mymean: display %9.3f r(mean)       
  5.                                 estadd local mD `mymean', replace       
  6.                                 estadd local state_fe "\checkmark": r_`dep_var'
  7.                                 estadd local mayor_municipal "\checkmark": r_`dep_var'
  8.                                 * Add Test interactions
.                                 lincom before + median_before
  9.                                 local estimate: display %9.3f r(estimate)
 10.                                 local p_test: display %9.3f r(p)
 11.                                 estadd local b0_b2 `estimate': r_`dep_var'
 12.                                 estadd local p_value `p_test': r_`dep_var'              
 13.         }

added macro:
                 e(mD) : "0.983"

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
camp_propa~c | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .1047168   .1218153     0.86   0.390    -.1344137    .3438473
------------------------------------------------------------------------------

added macro:
                 e(mD) : "0.188"

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
camp_pe~l_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |  -.0038551   .0628564    -0.06   0.951    -.1272459    .1195357
------------------------------------------------------------------------------

added macro:
                 e(mD) : "0.415"

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
 camp_gas_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .0839676   .0703397     1.19   0.233    -.0541133    .2220486
------------------------------------------------------------------------------

added macro:
                 e(mD) : "0.189"

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
camp_bens_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |    .061701   .0598308     1.03   0.303    -.0557504    .1791524
------------------------------------------------------------------------------

added macro:
                 e(mD) : "0.176"

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
camp_serv_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .0449665   .0534653     0.84   0.401    -.0599889     .149922
------------------------------------------------------------------------------

added macro:
                 e(mD) : "0.410"

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
camp_baixa~c | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .0690946   .0987557     0.70   0.484    -.1247685    .2629578
------------------------------------------------------------------------------

added macro:
                 e(mD) : "0.110"

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
camp_nonsp~c | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .0121313   .0322546     0.38   0.707    -.0511864     .075449
------------------------------------------------------------------------------

added macro:
                 e(mD) : "0.372"

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
camp_ou~p_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .0971696   .1064816     0.91   0.362      -.11186    .3061992
------------------------------------------------------------------------------

.         
. label var before "Before"       

.                 #delimit;
delimiter now ;
.                 esttab 
>                         r_camp_propa_pc r_camp_pessoal_pc r_camp_gas_pc r_camp_bens_pc r_camp_serv_pc  r_camp_baixa_pc r_camp_nonspe_pc r_camp_outraex
> p_pc      
>                         using "tables and figures\table_d5.tex", b(3) se compress label star(* 0.10 ** 0.05 *** 0.01) replace
>                         keep(before above_median_corrupt median_before ) stats(N mD r2_a b0_b2 p_value, fmt(%9.0fc %9.3fc ) labels("Observations" "Dep
> . Var. Mean" "Adjusted R$^2$" "$\beta_0+\beta_2 \, c_{ist}$" "p-value"))
>                         /*nonum*/ ar2 booktabs nonotes  
>                         substitute(\begin{table}[htbp]\centering \centering \caption{deletethis} /*\footnotesize*/{ \end{tabular} \end{tabular} \end{t
> able} %);
(output written to tables and figures\table_d5.tex)

.                         #delimit cr
delimiter now cr
. 
.         
. 
. * Table d.6 
.         global BEFORE before

.         global corrupt broad    

.         local Other_reg "camp_prop_pc camp_prop_pc camp_pessoas_pc camp_firm_pc camp_outrainc_pc"

.                 
.         foreach dep_var of varlist `Other_reg' {
  2.             
.         * Median  + controls
.             
.                         eststo m_c_`dep_var': quietly areg `dep_var' $BEFORE above_median_corrupt median_before $muni_controls $mayor_controls i.term 
> if sample_camp_exp == 1, absorb(codigo_uf) robust  cluster(id_city)
  3.                                 sum `dep_var' if e(sample), mean 
  4.                                 loc mymean: display %9.3f r(mean)       
  5.                                 estadd local mD `mymean', replace       
  6.                                 estadd local state_fe "\checkmark": m_c_`dep_var'
  7.                                 estadd local mayor_municipal "\checkmark": m_c_`dep_var'
  8.                                 * Add Test interactions
.                                 lincom $BEFORE + median_before
  9.                                 local estimate: display %9.3f r(estimate)
 10.                                 local p_test: display %9.3f r(p)
 11.                                 estadd local b0_b2 `estimate': m_c_`dep_var'
 12.                                 estadd local p_value `p_test': m_c_`dep_var'                            
 13.         }

added macro:
                 e(mD) : "1.032"

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
camp_prop_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .3195609   .1925323     1.66   0.097    -.0583857    .6975074
------------------------------------------------------------------------------

added macro:
                 e(mD) : "1.032"

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
camp_prop_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .3195609   .1925323     1.66   0.097    -.0583857    .6975074
------------------------------------------------------------------------------

added macro:
                 e(mD) : "0.912"

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
camp_pe~s_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .0722467   .1435652     0.50   0.615    -.2095761    .3540695
------------------------------------------------------------------------------

added macro:
                 e(mD) : "0.563"

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
camp_firm_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .2180266   .1917604     1.14   0.256    -.1584047    .5944579
------------------------------------------------------------------------------

added macro:
                 e(mD) : "0.364"

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
camp_ou~c_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .0240902   .1027559     0.23   0.815    -.1776228    .2258031
------------------------------------------------------------------------------

.         
.  eststo dir

--------------------------------------------------------------------------------------
             |           Dependent  Number of        
        Name | Command    variable     param.  Title 
-------------+------------------------------------------------------------------------
 rerun_basic | areg          rerun          4  Linear regression, absorbing indicators
rerun_basi~c | areg          rerun         16  Linear regression, absorbing indicators
 rerun_broad | areg          rerun          6  Linear regression, absorbing indicators
rerun_broa~c | areg          rerun         18  Linear regression, absorbing indicators
rerun_frac~n | areg          rerun          6  Linear regression, absorbing indicators
rerun_frac~c | areg          rerun         18  Linear regression, absorbing indicators
rerun_median | areg          rerun          6  Linear regression, absorbing indicators
rerun_medi~c | areg          rerun         18  Linear regression, absorbing indicators
 rerun_quart | areg          rerun         10  Linear regression, absorbing indicators
rerun_quar~c | areg          rerun         22  Linear regression, absorbing indicators
r_camp_pro~c | areg      camp_propa~c      18  Linear regression, absorbing indicators
r_camp_pes~c | areg      camp_pe~l_pc      18  Linear regression, absorbing indicators
r_camp_gas~c | areg      camp_gas_pc       18  Linear regression, absorbing indicators
r_camp_ben~c | areg      camp_bens_pc      18  Linear regression, absorbing indicators
r_camp_ser~c | areg      camp_serv_pc      18  Linear regression, absorbing indicators
r_camp_bai~c | areg      camp_baixa~c      18  Linear regression, absorbing indicators
r_camp_non~c | areg      camp_nonsp~c      18  Linear regression, absorbing indicators
r_camp_out~c | areg      camp_ou~p_pc      18  Linear regression, absorbing indicators
m_c_camp_p~c | areg      camp_prop_pc      18  Linear regression, absorbing indicators
m_c_camp_p~c | areg      camp_pe~s_pc      18  Linear regression, absorbing indicators
m_c_camp_f~c | areg      camp_firm_pc      18  Linear regression, absorbing indicators
m_c_camp_o~c | areg      camp_ou~c_pc      18  Linear regression, absorbing indicators
--------------------------------------------------------------------------------------

.                 #delimit;
delimiter now ;
.                 esttab 
>                         m_c_camp_prop_pc m_c_camp_pessoas_pc  m_c_camp_firm_pc  m_c_camp_outrainc_pc  
>                         using "tables and figures\table_d6.tex", b(3) se compress label star(* 0.10 ** 0.05 *** 0.01) replace 
>                         keep($BEFORE above_median_corrupt median_before ) stats(N mD r2_a b0_b2 p_value, fmt(%9.0fc %9.3fc ) labels("Observations" "De
> p. Var. Mean" "Adjusted R$^2$" "$\beta_0+\beta_2 \, c_{ist}$" "p-value"))
>                         /*nonum*/ ar2 booktabs nonotes /*nomtitles*/ title(deletethis) 
>                         substitute(\begin{table}[htbp]\centering \centering \caption{deletethis} /*\footnotesize*/{ \end{tabular} \end{tabular}} \end{
> table} %);
(output written to tables and figures\table_d6.tex)

.                         #delimit cr
delimiter now cr
.         
.         
.         
. *Table_d7
. eststo clear    

. *incumbent
.                 eststo reg_median_c_inc_2001: quietly areg camp_exp_pc before above_median_corrupt median_before  $muni_controls $mayor_controls if te
> rm == 2001, absorb(codigo_uf) robust  cluster($cluster)

.                                 sum camp_exp_pc if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "2.600"

.                                 estadd local state_fe "\checkmark": reg_median_c_inc_2001

.                                 estadd local mayor_municipal "\checkmark": reg_median_c_inc_2001

.                                 lincom before + median_before

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .4604169   .4435809     1.04   0.300    -.4114002    1.332234
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': reg_median_c_inc_2001

.                                 estadd local p_value `p_test': reg_median_c_inc_2001

. 
.                 eststo reg_median_c_inc_2005: quietly areg camp_exp_pc before above_median_corrupt median_before  $muni_controls $mayor_controls if te
> rm == 2005, absorb(codigo_uf) robust  cluster($cluster)

.                                 sum camp_exp_pc if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "3.134"

.                                 estadd local state_fe "\checkmark": reg_median_c_inc_2005

.                                 estadd local mayor_municipal "\checkmark": reg_median_c_inc_2005

.                                 lincom before + median_before

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .6841721   .4599951     1.49   0.138    -.2201588    1.588503
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': reg_median_c_inc_2005

.                                 estadd local p_value `p_test': reg_median_c_inc_2005

.                                 
. 
.                 eststo reg_median_c_inc_radio: quietly areg camp_exp_pc before above_median_corrupt median_before  $muni_controls $mayor_controls i.te
> rm if radio == 1, absorb(codigo_uf) robust  cluster($cluster)

.                                 sum camp_exp_pc if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "2.171"

.                                 estadd local state_fe "\checkmark": reg_median_c_inc_radio

.                                 estadd local mayor_municipal "\checkmark": reg_median_c_inc_radio

.                                 lincom before + median_before

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   1.054983   .7893495     1.34   0.183    -.5020309    2.611997
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': reg_median_c_inc_radio

.                                 estadd local p_value `p_test': reg_median_c_inc_radio

. 
. 
.                 eststo reg_median_c_inc_no_radio: quietly areg camp_exp_pc before above_median_corrupt median_before  $muni_controls $mayor_controls i
> .term if radio == 0, absorb(codigo_uf) robust  cluster($cluster)

.                                 sum camp_exp_pc if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "3.070"

.                                 estadd local state_fe "\checkmark": reg_median_c_inc_no_radio

.                                 estadd local mayor_municipal "\checkmark": reg_median_c_inc_no_radio

.                                 lincom before + median_before

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |    .500442    .366581     1.37   0.173    -.2195229    1.220407
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': reg_median_c_inc_no_radio

.                                 estadd local p_value `p_test': reg_median_c_inc_no_radio

.                                                                                 
.                                                                                 
.                                                                                 
. * Challenger                    
. preserve

. 
. use "data_brasil_camp_chall.dta", clear

.         
.                 eststo reg_median_c_chal_2001: quietly areg camp_exp_pc before above_median_corrupt median_before $muni_controls $challenger_controls 
> if term == 2001, absorb(codigo_uf) robust  cluster($cluster)

.                                 sum camp_exp_pc if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "2.657"

.                                 estadd local state_fe "\checkmark": reg_median_c_chal_2001

.                                 estadd local mayor_municipal "\checkmark": reg_median_c_chal_2001

.                                 lincom before + median_before

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |    1.36941   .5098199     2.69   0.008     .3672936    2.371526
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': reg_median_c_chal_2001

.                                 estadd local p_value `p_test': reg_median_c_chal_2001

. 
.                 eststo reg_median_c_chal_2005: quietly areg camp_exp_pc before above_median_corrupt median_before $muni_controls $challenger_controls 
> if term == 2005, absorb(codigo_uf) robust  cluster($cluster)

.                                 sum camp_exp_pc if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "3.956"

.                                 estadd local state_fe "\checkmark": reg_median_c_chal_2005

.                                 estadd local mayor_municipal "\checkmark": reg_median_c_chal_2005

.                                 lincom before + median_before

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .6332387    .595101     1.06   0.288    -.5370505    1.803528
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': reg_median_c_chal_2005

.                                 estadd local p_value `p_test': reg_median_c_chal_2005

.                                 
.                                 
. 
.                 eststo reg_median_c_chal_radio: quietly areg camp_exp_pc before above_median_corrupt median_before $muni_controls $challenger_controls
>  i.term if radio == 1, absorb(codigo_uf) robust  cluster($cluster)

.                                 sum camp_exp_pc if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "2.369"

.                                 estadd local state_fe "\checkmark": reg_median_c_chal_radio

.                                 estadd local mayor_municipal "\checkmark": reg_median_c_chal_radio

.                                 lincom before + median_before

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   .1511423   .6679498     0.23   0.821    -1.167028    1.469313
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': reg_median_c_chal_radio

.                                 estadd local p_value `p_test': reg_median_c_chal_radio

. 
.                 eststo reg_median_c_chal_no_radio: quietly areg camp_exp_pc before above_median_corrupt median_before $muni_controls $challenger_contr
> ols i.term if radio == 0, absorb(codigo_uf) robust  cluster($cluster)

.                                 sum camp_exp_pc if e(sample), mean 

.                                 loc mymean: display %9.3f r(mean)       

.                                 estadd local mD `mymean', replace       

added macro:
                 e(mD) : "3.549"

.                                 estadd local state_fe "\checkmark": reg_median_c_chal_no_radio

.                                 estadd local mayor_municipal "\checkmark": reg_median_c_chal_no_radio

.                                 lincom before + median_before

 ( 1)  before + median_before = 0

------------------------------------------------------------------------------
 camp_exp_pc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   1.229828    .507558     2.42   0.016     .2328226    2.226833
------------------------------------------------------------------------------

.                                 local estimate: display %9.3f r(estimate)

.                                 local p_test: display %9.3f r(p)

.                                 estadd local b0_b2 `estimate': reg_median_c_chal_no_radio

.                                 estadd local p_value `p_test': reg_median_c_chal_no_radio

.                                                 
. restore                                                                         

.                                 
. 
.                 #delimit;
delimiter now ;
.                         esttab reg_median_c_inc_2001     reg_median_c_chal_2001 
>                                    reg_median_c_inc_2005         reg_median_c_chal_2005
>                                    reg_median_c_inc_radio        reg_median_c_chal_radio 
>                                    reg_median_c_inc_no_radio reg_median_c_chal_no_radio                 
>                         using "tables and figures\table_d7.tex", b(3) se compress label star(* 0.10 ** 0.05 *** 0.01) replace
>                         keep(before median_before above_median_corrupt   ) 
>                         mtitles( "Incumbent" "Challenger"  "Incumbent" "Challenger" "Incumbent" "Challenger"  "Incumbent" "Challenger") 
>                         mgroups( "Term 2001-2004" "Term 2005-2008"  "Local Radio" "No local radio", pattern(1 0 1 0 1 0 1 0 ) prefix(\multicolumn{@spa
> n}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) 
>                         stats(N mD mayor_municipal state_fe r2_a b0_b2 p_value, fmt(%9.0fc %9.3fc ) labels("Observations" "Dep. Var. Mean" "Mayor and 
> municipal controls" "State and term FE" "Adjusted R$^2$" "$\beta_0+\beta_2 \, c_{ist}$" "p-value"))
>                         /*nonum*/ ar2 booktabs nonotes title(deletethis) 
>                         substitute(\begin{table}[htbp]\centering \centering \caption{deletethis} /*\footnotesize*/{ \end{tabular} \end{tabular}} \end{
> table} %);
(output written to tables and figures\table_d7.tex)

.                         #delimit cr
delimiter now cr
.                                                  
. eststo clear     

. 
end of do-file

. 
. * End timer
. timer off 1

. timer list 1

. 
. * Close log file
. log close
      name:  <unnamed>
       log:  C:\Users\75618rpo\Dropbox\Research\Literature Latex\Corruption, accountability and voting\Submission R&R JoP\Replication\replication_packag
> e_JOP\cleaning_running.log
  log type:  text
 closed on:  22 Feb 2024, 09:33:06
--------------------------------------------------------------------------------------------------------------------------------------------------------
